-
-
Notifications
You must be signed in to change notification settings - Fork 437
"DevTools failed to parse SourceMap" for sapper-template#rollup #808
Comments
Playing around some more, it looks like other source maps are compiling okay. It's just that one particular file that's problematic. The
and it's only the last chunk that's failing.
|
Looks like the .js.map just isn't valid JSON:
It looks like it's this part of the Which I can't find verbatim in my source tree, but looks like these snippets from src/node_modules/@sapper/internal/manifest-client.mjs:
I'm guessing the attempt at substituting |
Instrumenting
I see:
and it goes on quite a bit longer. It looks like what's happening is:
|
When substituting __SAPPER_CSS_PLACEHOLDER:foo__, tighten the regexp to require matching quotation marks and to not match too much if there's an error. Also, make the replacement logic smart about recognizing when we're matching JavaScript code that's been quoted (e.g., in source maps), and to generate a substitution that's still valid in that context. Fixes sveltejs#808.
When substituting __SAPPER_CSS_PLACEHOLDER:foo__, tighten the regexp to require matching quotation marks and to not match too much if there's an error. Also, make the replacement logic smart about recognizing when we're matching JavaScript code that's been quoted (e.g., in source maps), and to generate a substitution that's still valid in that context. Fixes #808.
When I build sapper-template using the rollup configuration, loading the page in Chrome 75 prints
Devtools failed to parse SourceMap: http://localhost:3000/client/client.0e04fd89.js.map
.Repro steps are just:
and then open http://localhost:3000 in Chrome, and open the DevTools console.
Notably, if the webpack config is used and tweaked to enable source maps in production builds like so:
then there's no error message, and source maps seem to work correctly.
The text was updated successfully, but these errors were encountered: