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

Disable generating SourceMaps? #104

Open
tjramage opened this issue Aug 4, 2017 · 8 comments
Open

Disable generating SourceMaps? #104

tjramage opened this issue Aug 4, 2017 · 8 comments

Comments

@tjramage
Copy link

tjramage commented Aug 4, 2017

The sourceMappingUrl comment that is added to the bottom of our styles (that appear in the HTML head) doesn't actually resolve to a proper source map.

I'm using babel-plugin-react-css-modules instead of react-css-modules, which means I simply import my styles without declaring a reference in my React components, and it maps the styleName prop to the imported SCSS stylesheet: import 'App.scss'

Can you tell me if there is a way to disable these source maps entirely? It basically means we end up with tons of "Failed to parse SourceMap" errors in the browser console:

sourcemaps

As well as being able to disable these (I tried running Meteor in production mode and they are still generated), is there any way to resolve the broken source map references?

Thanks!

@tjramage
Copy link
Author

@nathantreid — Sorry... any help on the above? Thanks!

@akanix42
Copy link
Owner

akanix42 commented Sep 14, 2017

Sorry about the slow response! This isn't currently a customizable option; I'll look into it when I get a chance, but in the meantime if you want to change it in a local copy of the package, it's probably coming from here.

@tjramage
Copy link
Author

No worries @nathantreid — thanks for the reply. I'll look into running a customised local package at some point. Cheers.

@egemon
Copy link

egemon commented Nov 14, 2017

Hey guys, I am getting this warnings too. How could i change it in local package? Don't u propose me to go to node_modules folder?))

@yched
Copy link

yched commented Jan 2, 2018

Like the OP, I'm seeing the "DevTools failed to parse SourceMap: http://localhost:3000/url/of/the/page/currently/being/viewed/minus/the/last/part/MyComponent.css.map" messages in Chrome.

Rather than disabling sourceMaps, though, I'd like to get them working :-)
(although being able to disable them in production would also be nice I guess...)

I'm not sure at which URL they're supposed to be available, but with the current /*# sourceMappingURL=MyComponent.css.map */ comment, Chrome apparently tries to fetch them from a URL relative to the current page, which if course fails

@cdolek
Copy link

cdolek commented Jan 8, 2018

Hi @nathantreid forked the package in order to work on this issue but when I use the local version (which I generated by ./prepare.sh) it downgrades to 2.8 from 3.0 and installs other npm packages which were not previously installed. Any recommendations?

Thanks

@akanix42
Copy link
Owner

akanix42 commented Jan 8, 2018

You can update the version number in package.js. Btw, 2.8 and 3.0 are the same. To support both Meteor 1.6 and 1.5, I needed to introduce a major version update. When building locally like you're doing, there are no differences between the two. Looks like I need to commit my changelog!
The npm packages it's installing are ones used by my css-modules plugin. They aren't accessible to the rest of the app.

Let me know if you have any more questions!

@akanix42
Copy link
Owner

@cdolek I believe this issue has been fixed in v3.0.1. Please give it a shot!

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