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

[BUG] Invalid sourceMappingURL in bundle output #3108

Closed
4 tasks done
limulus opened this issue Apr 7, 2021 · 3 comments
Closed
4 tasks done

[BUG] Invalid sourceMappingURL in bundle output #3108

limulus opened this issue Apr 7, 2021 · 3 comments

Comments

@limulus
Copy link

limulus commented Apr 7, 2021

Bug Report Quick Checklist

  • I am on the latest version of Snowpack & all plugins.
  • I use package manager npm
  • I run Snowpack on macOS
  • I run Snowpack on Node.js v14.16.1

Describe the bug

When using optimize.bundle, the sourceMappingURL comment at the end of the file contains extraneous slashes that cause browsers not to be able to load the source map.

To Reproduce

  1. npm init snowpack-app --template @snowpack/app-template-react
  2. Uncomment "bundle": true in snowpack.config.js. (If [BUG] Built-in optimizations doesn't respect sourcemap option #2935 is already fixed you should also add sourcemap: true to optimize)
  3. Run npm run build
  4. View last line of build/dist/index.js and observe the sourceMappingURL value: //# sourceMappingURL=//dist//index.js.map
  5. Optional: Load build/dist/index.html in a browser, bring up the browser’s dev tools, and see it fail to load the source map file because it interprets it as a scheme relative URL with a host of dist.

Expected behavior

The sourceMappingURL value should be a valid URL. Probably just a relative URL like index.js.map.

@Lyanthropos
Copy link

Probably the same underlying issue as #3110 and #3111

@drwpow
Copy link
Collaborator

drwpow commented Apr 16, 2021

Thanks for raising! Yes it might be related to #3110 and #3111, but overall this is a symptom of needing better sourcemap support in general in Snowpack. A lot of people have asked for better sourcemap support and we’re working on it now! In that light, I’m going to close this in favor of our current issue for tracking: #1213

@drwpow drwpow closed this as completed Apr 16, 2021
@limulus
Copy link
Author

limulus commented Apr 17, 2021

Confirmed that this is fixed in v3.3.3! 👍

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

3 participants