-
Notifications
You must be signed in to change notification settings - Fork 8
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
Incorrect paths in sources
?
#9
Comments
I'm afraid I can't install the node modules on my M1 MPB, so I can't run the test suite. I have an idea of what's gone wrong. Can you try running |
Sure, no problem. I'll give it a try 👍 |
Yes, this fixes it 👍 I now get: {
source: '// This will cause an error during SSR because window is not defined\n' +
'exports.onPreRenderHTML = () => {\n' +
' window.location.pathname\n' +
'}\n'
} Which is what I expect. So the |
Ok, I can release a new version in about 2 hours. |
No worries, it's not super urgent so don't feel pressured to rush this :) Release it when you have time. Thank you! |
Hi! I come here from babel/babel#14676. I think that the fix should be reverted since it breaks other use cases, and most importantly the difference you see (the extra |
Hi, it's me again :)
For my current WIP PR gatsbyjs/gatsby#35621 our E2E tests fail (correctly, they caught a bug). The result in our CLI is that the codeFrame is not rendered. You don't have to have the context on Gatsby, I think I can explain the problem also without that knowledge.
So I'm using the new
sourceContentFor
here:https://github.com/gatsbyjs/gatsby/blob/source-map-migration/packages/gatsby-cli/src/reporter/prepare-stack-trace.ts#L73
It receives a
map
andtopFrame.getFileName()
which comes from here:https://github.com/gatsbyjs/gatsby/blob/source-map-migration/packages/gatsby-cli/src/reporter/prepare-stack-trace.ts#L47-L59
So we're using
stack-trace
to parse the stacktrace, it creates a stack and we're using the first item of that stack as a "topFrame".Now here comes the problem:
The
getFileName()
fromstack-trace
is different to the sources inside this library. When I log outmap.sources
andtopFrame.getFileName()
inside the loop, I get:So:
'webpack://source-map-testing/gatsby-ssr.js' !== 'webpack://source-map-testing/./gatsby-ssr.js'
I think this is a bug inside this library, would you agree?
The text was updated successfully, but these errors were encountered: