Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[conf, ajv] DevTools failed to load SourceMaps #69

Open
wojciechkrzysztofik opened this issue Apr 6, 2021 · 4 comments
Open

[conf, ajv] DevTools failed to load SourceMaps #69

wojciechkrzysztofik opened this issue Apr 6, 2021 · 4 comments

Comments

@wojciechkrzysztofik
Copy link

wojciechkrzysztofik commented Apr 6, 2021

Hey guys!

I spotted weird issue. It appears on development and production version as well. DevTools throws lots of warnings like: "DevTools failed to load SourceMap: Could not load content for http://localhost:8081/MY_APP_PATH/node_modules/conf/node_modules/ajv/dist/ajv.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE".

Any idea how to solve this?

It's vuex-electron v1.0.3, ajv v6.12.6 and conf v9.0.2.

@carldr
Copy link

carldr commented May 28, 2021

I've had this too, and couldn't find a way of either rewriting the URLs to they actually loaded, and I wanted source maps to be enabled for my own code, so I couldn't disable them. Temporarily, until I do find a solution, I've done this to to remove the sourceMappingURLs from the modules.

In package.json :

"scripts": {
  ...
  "postinstall": "./fix-node-module-source-maps.sh"
  ...
}

And in the root of my app, a file fix-node-module-source-maps.sh, set executable :

echo "Removing any sourceMappingURLs from ajv-formats"
for i in `find node_modules/ajv-formats -name \*.js -type f`
do
	perl -p -i.bak -e 's|//# sourceMappingURL=.*$||' $i
done

echo "Removing any sourceMappingURLs from conf"
for i in `find node_modules/conf -name \*.js -type f`
do
	perl -p -i.bak -e 's|//# sourceMappingURL=.*$||' $i
done

echo "Removing any sourceMappingURLs from url-js"
perl -p -i.bak -e 's|//# sourceMappingURL=.*$||' node_modules/uri-js/dist/es5/uri.all.js

You might not need the one for uri-js, but I did.

I suspect the answer is for these modules not to include sourceMappingURLs in their built files, it seems other modules don't include them. I'm new to Electron and npm, so I really don't know. It might be worth opening a ticket with them.

@ferm10n
Copy link

ferm10n commented Jun 19, 2021

This is actually (at least in part) from electron-store. I just started a fresh project and those source map errors started appearing the moment I added import ElectronStore from "electron-store";. This was before I even added vuex-electron!

@bart
Copy link

bart commented Dec 22, 2021

Also having this issue caused by electron-store Any solution so far? Thanks!

@Gkiokan
Copy link

Gkiokan commented Jan 8, 2022

Had this in a while, too.

Add this to your dependencies. Note this is not in devDependencies because I needed it somehow in the production build, too.

 "dependencies": {
    // ... your other dependencies.
    "source-map-support": "^0.5.16",
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants