question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] 7.0.10 in development causes SourceMapConsumer.initialize errors

See original GitHub issue

Reporting a bug?

After upgrading from 7.0.9 to 7.0.10 my development environment fails to build giving the following error:

  Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer

  - read-wasm.js:8 readWasm
    [react-static-prismic-v7]/[react-hot-loader]/[source-map]/lib/read-wasm.js:8:13

  - wasm.js:25 wasm
    [react-static-prismic-v7]/[react-hot-loader]/[source-map]/lib/wasm.js:25:16

  - source-map-consumer.js:264 BasicSourceMapConsumer.then.that
    [react-static-prismic-v7]/[react-hot-loader]/[source-map]/lib/source-map-consumer.js:264:14

This seems to happen when I’m importing the following package:

import Prismic from "prismic-javascript";

When prismic-javascript is commented out, the local server starts as expected.

Directly including this package in the static.config.js does not produce this error on a clean React Static install, but when calling functions from other files that have this imported, the build does not work on 7.0.10 for some reason.

Everything works fine on production.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

12reactions
guill3mcommented, May 27, 2019

I was having the same issue and eventually, we found the following workaround as all seemed to point to source map generation being the culprit.

Create a node.api.js file in your root folder and add the following:

export default () => ({
  webpack: config => {
    config.devtool = process.env.NODE_ENV === 'production' ? false : 'eval'
    return config
  },
})

Eval source maps seem to be working fine, you could also just set it to false if you prefer, any other value seemed to fail in our case.

Working with react-static v7.0.10 and prismic-javascript v2.0.3

5reactions
fresh5447commented, May 15, 2019

I did find a workaround to at least get us developing… Just set the node env to production at the top of static.config.js

process.env.NODE_ENV = 'production'
import Prismic from 'prismic-javascript'
Read more comments on GitHub >

github_iconTop Results From Across the Web

you must provide the url of lib/mappings.wasm by calling ...
Reporting a bug? After upgrading from 7.0.9 to 7.0.10 my development environment fails to build giving the following error:.
Read more >
Cisco Firepower Release Notes, Version 7.1 - Cisco
Resolved Bugs in Version 7.1.0 ; CSCvv40916. 3 min delay caused by AbstractBaseDeploymentValidationHandler.validatePreApply during deploy.
Read more >
Bug Check 0x6B PROCESS1_INITIALIZATION_FAILED
This bug check indicates that the initialization of the Microsoft Windows operating system failed. This topic is for programmers.
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug :2 - "How do I attach an ebuild. ... Bug:1274 - "Missing HOSTNAME environment variable causes python errors" status:RESOLVED resolution:FIXED severity: ...
Read more >
Troubleshooting Common Errors - Gatsby
Some packages, like Babel, bring fs along for the ride anyway. In order to prevent it from causing errors, you can add the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found