You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
View last line of build/dist/index.js and observe the sourceMappingURL value: //# sourceMappingURL=//dist//index.js.map
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.
The text was updated successfully, but these errors were encountered:
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
Bug Report Quick Checklist
Describe the bug
When using
optimize.bundle
, thesourceMappingURL
comment at the end of the file contains extraneous slashes that cause browsers not to be able to load the source map.To Reproduce
npm init snowpack-app --template @snowpack/app-template-react
"bundle": true
insnowpack.config.js
. (If [BUG] Built-in optimizations doesn't respect sourcemap option #2935 is already fixed you should also addsourcemap: true
tooptimize
)npm run build
build/dist/index.js
and observe thesourceMappingURL
value://# sourceMappingURL=//dist//index.js.map
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 ofdist
.Expected behavior
The
sourceMappingURL
value should be a valid URL. Probably just a relative URL likeindex.js.map
.The text was updated successfully, but these errors were encountered: