Skip to content

fix: restore correct SSR sourcemaps for precompiled JSX#3827

Open
Hajime-san wants to merge 7 commits into
freshframework:mainfrom
Hajime-san:fix-rollup-sourcemap
Open

fix: restore correct SSR sourcemaps for precompiled JSX#3827
Hajime-san wants to merge 7 commits into
freshframework:mainfrom
Hajime-san:fix-rollup-sourcemap

Conversation

@Hajime-san
Copy link
Copy Markdown
Contributor

"@babel/core": "npm:@babel/core@^7.28.0",
"@babel/preset-react": "npm:@babel/preset-react@^7.27.1",
"@deno/loader": "jsr:@deno/loader@^0.4.0",
"@deno/loader": "jsr:@deno/loader@^0.5.0",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the version because we needed the source map generation feature implemented in the PR.

Comment on lines +625 to +637
// In dev, plugins may mutate app-level hooks such as the error interceptor
// after this module loads. Keep the fetch target refreshable so the server
// entry can pick up the latest app.handler() when that happens.
let handler = app.handler();

export function refreshHandler() {
handler = app.handler();
}

export default {
fetch: app.handler()
fetch(req, info) {
return handler(req, info);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • integrationTest("vite dev - source mapped stack traces", async () => {
    const res = await fetch(`${demoServer.address()}/tests/throw`);
    const text = await res.text();
    expect(text).toContain("throw.tsx:5:11");
    });

This fix is for the flaky test of vite dev - source mapped stack traces.


export function setErrorInterceptor(fn) {
internalErrorIntercept(app, fn);
refreshHandler();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for flaky test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: environments.ssr.build.sourcemap not generate sourcemap collectly with @fresh/plugin-vite

1 participant