Skip to content
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

Sourcemaps are not emitted when using ssr and vite 4.0 #11344

Closed
7 tasks done
thebanjomatic opened this issue Dec 12, 2022 · 1 comment · Fixed by #11343
Closed
7 tasks done

Sourcemaps are not emitted when using ssr and vite 4.0 #11344

thebanjomatic opened this issue Dec 12, 2022 · 1 comment · Fixed by #11343

Comments

@thebanjomatic
Copy link
Contributor

thebanjomatic commented Dec 12, 2022

Describe the bug

When enabling SSR mode by setting:

{
  build: {
    ssr: true,
    sourcemap: true,
  }
}

Sourcemaps are no longer being emitted to the output directory. This appears to be the result of the rollup 3 upgrade since that change made sourcemaps into proper assets within the bundle, and vite has existing code that removes assets from the bundle for SSR builds which was not updated to go along with this change.

I have fixed this in the following PR: #11343

Reproduction

https://stackblitz.com/edit/vitejs-vite-bqd6xy?file=vite.config.ts

Steps to reproduce

Run npm install followed by npm run build and check the output produced in the ./dist folder. you will only see index.js and index.cjs, but there should also be index.js.map and index.cjs.map.

If you set ssr: false in the vite.config.ts file and re-run the steps above, the sourcemaps are produced correctly.

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    Memory: 13.68 GB / 31.64 GB
  Binaries:
    Node: 18.12.1 - ~\AppData\Local\Volta\tools\image\node\18.12.1\node.EXE
    Yarn: 1.22.19 - ~\AppData\Local\Volta\tools\image\yarn\1.22.19\bin\yarn.CMD
    npm: 8.19.2 - ~\AppData\Local\Volta\tools\image\node\18.12.1\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.819.0), Chromium (107.0.1418.56)
    Internet Explorer: 11.0.22621.1

Used Package Manager

yarn

Logs

No response

Validations

@curran
Copy link
Contributor

curran commented Dec 29, 2022

I also noticed that sourcemaps are not being generated.

Was tearing my hair out for a while thinking I was not configuring it properly, then stumbled on this issue.

Thanks for the issue and PR! Looking forward to when it lands.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants