-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix (remix-serve): Fix source map loading #8174
Conversation
This PR fixes the issue where source maps are not getting used. This was traced to how the map file is loaded when HMR reloads the server file with the `?t=timestamp` suffix. This causes the source map to not be found and therefore not used. Adding the hook for `retrieveSourceMap`, this strips out the unexpected characters from the filename and properly returns the soure map.
🦋 Changeset detectedLatest commit: 404de6a The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This PR updates the the Express template and fixes the issue where source maps are not getting used. This was traced to how the map file is loaded when HMR reloads the server file with the `?t=timestamp` suffix. This causes the source map to not be found and therefore not used. Adding the hook for `retrieveSourceMap`, this strips out the unexpected characters from the filename and properly returns the source map.
Ugh. I created 2 PRs back-to-back, one for Remix App Server and one for the Express template. I forgot to branch off of upstream/dev on the 2nd PR, so that template fix is added to this one. I created the 2nd PR, which only has the template fix, but if you merge this one, that PR is obviated. Since these two are related, I don't think it would be an issue. Anyway, let me know how you guys want to handle this. Sorry, it's been a while doing PRs. |
@kiliman Thank you so much for the fix 💌 |
This PR adds the fix submitted in Remix PR #8174. The issue is caused when the build server imports an updated server build with a ?t=timestamp suffix. This causes the source map support library to fail to load the source map. remix-run/remix#8174
* fix (server): Fix source map retrieval for updated builds This PR adds the fix submitted in Remix PR #8174. The issue is caused when the build server imports an updated server build with a ?t=timestamp suffix. This causes the source map support library to fail to load the source map. remix-run/remix#8174 * Update index.js * fix lint/build issues --------- Co-authored-by: Kent C. Dodds <[email protected]>
This looks good to me on both express and remix-serve. Here's a screenshot of the before/after (I applied these changes to I'm going to kick this over to @pcattori and @jacob-ebey for a confirmation though since they're more in tune with the HMR + source maps flows. |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Hi @kiliman! This PR seems to have introduced a new bug, as mentioned in the above issue. I would be really grateful if you could take a look. |
Thanks. I'll take a look in the morning. |
* fix (server): Fix source map retrieval for updated builds This PR adds the fix submitted in Remix PR #8174. The issue is caused when the build server imports an updated server build with a ?t=timestamp suffix. This causes the source map support library to fail to load the source map. remix-run/remix#8174 * Update index.js * fix lint/build issues --------- Co-authored-by: Kent C. Dodds <[email protected]>
This PR fixes the issue where source maps are not getting used. This was traced to how the map file is loaded when HMR reloads the server file with the
?t=timestamp
suffix.This causes the source map to not be found and therefore not used.
Adding the hook for
retrieveSourceMap
, this strips out the unexpected characters from the filename and properly returns the source map.Closes: #8168.