Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
Will do
Summary
The source maps we're generating at the moment are quite junk, unfortunately.
This is the
"sources"
key taken frombundle.<hash>.js.map
from our default template. Notice some of those entries like../src/diff/children.js
or../src/util.js
. Apparently, Webpack's handling of sourcemaps without their sourcemap loader is quite poor, and leads to situations like this. Now we'd recognize that as being from Preact itself, but to a user? Who knows where that's from.Result after this change:
We set Webpack's context to
env.src
, hence the maybe odd looking paths. All works great though, no longer is Preact stuff mixed with user code in a debugger!The changes to
prerender.js
are just for skipping work. #1426 limited showing the code frame to user code but our handler still did the full work of trying to track down the position regardless. I can extract it out to a separate PR if desirable, was chasing down a prerender error for Signals and was butting up against poor error message logic and broken source maps.Does this PR introduce a breaking change?
No