-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
@wordpress/scripts: sourcemap missing in builds #44278
Comments
It looks like you can use
I think a reasonable change would be to allow
|
It's gutenberg/packages/scripts/config/webpack.config.js Lines 302 to 307 in 148c816
So maybe we should include that when |
Heyho, I just wanted to jump in to ask about the current state of this ticket. What I can see is, that See modes here: https://webpack.js.org/configuration/mode/ Overall the Add to the Available values are defined here: https://webpack.js.org/configuration/devtool/ This soltuion does not introduce any breaking change, but allows to build a source map when you decide that you need it. So the default behavior does not change.
|
There is no reason production builds should not include sourcemaps by default - without sourcemaps, debugging the error or - for users - reporting errors is not possible, making the website and the web in general less accessible * analogous to WordPress#33718 * Fix: WordPress#44278 * Fix: WordPress#41551
Any update here? Will this be part of the next release of |
I have just landed #46812 to resolve this issue. There is still #45251 in works, that proposes creating souremaps by default which we might land later. As for the release date, we had npm publishing yesterday, so we need to wait another 2 weeks because the process is tied to the Gutenberg plugin release cycle. |
It looks like the pr #46812 was merged and I was able to get the source map for my JS file to be created during the In our environment we find it very useful to publish source maps for our compiled SASS / CSS for testing/debugging in production and being able to apply a quick css hotfix. I've been trying for a few hours to find a way to do this but it seems the I've been attempting to use We're trying to move from an old grunt based build process to |
@gziolo thanks, but can you please reopen the issue? While there's an option to include sourcemaps, this should become the default behavior to keep WP an open and accessible ecosystem. Open to discussion, also on the PR since nobody replied to the arguments in the end #45251 (comment) |
Description
@wordpress/scripts
scriptwp-scripts build
doesn't generate a sourcemap (onlywp-scripts start
will)This means all production errors cannot be investigated or fixed, as all reported info (e.g. in Sentry) is useless.
It seems this was changed already #33718 but this doesn't affect @wordpress/scripts? (sorry JS isn't my area of expertise)
(kind of related #23960, but I think that issue is already fixed by the above PR)
@gziolo could you please quickly change it or point me towards where I can change and PR this? Thanks!
Step-by-step reproduction instructions
run "npm run build", it won't generate a .map
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: