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

Vite does not generate sourcemaps even with build.sourcemap: true #8935

Closed
Hansenq opened this issue Feb 28, 2024 · 3 comments
Closed

Vite does not generate sourcemaps even with build.sourcemap: true #8935

Hansenq opened this issue Feb 28, 2024 · 3 comments

Comments

@Hansenq
Copy link

Hansenq commented Feb 28, 2024

Reproduction

I'm able to reproduce this on the latest create-remix template.

  1. Run npx create-remix@latest --template remix-run/remix/templates/vite
  2. Edit vite.config.ts to set build.sourcemap to true:
export default defineConfig({
  build: {
    sourcemap: true, // Doesn't work with the "inline" option either
  },
  plugins: [remix(), tsconfigPaths()],
});
  1. Run npm run build
  2. Look at the files in build/client/assets. None of them end in .js.map, which would be expected if sourcemaps are being generated.

System Info

System:
    OS: macOS 14.3
    CPU: (12) arm64 Apple M2 Pro
    Memory: 119.28 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.1.0 - ~/.nvm/versions/node/v21.1.0/bin/node
    npm: 10.2.0 - ~/.nvm/versions/node/v21.1.0/bin/npm
  Browsers:
    Chrome: 122.0.6261.69
    Safari: 17.3
  npmPackages:
    @remix-run/dev: ^2.7.2 => 2.7.2
    @remix-run/node: ^2.7.2 => 2.7.2
    @remix-run/react: ^2.7.2 => 2.7.2
    @remix-run/serve: ^2.7.2 => 2.7.2
    vite: ^5.1.0 => 5.1.4

Used Package Manager

npm

Expected Behavior

When running npm run build with vite's config build.sourcemap set to true, I expect sourcemaps to be in the bundled output. If you look at the bundled output below, none of the files end in .map.js

Actual Behavior

The output is being bundled correctly, but no sourcemaps are being generated.


> build
> remix vite:build

vite v5.1.4 building for production...
✓ 80 modules transformed.
build/client/.vite/manifest.json                0.90 kB │ gzip:  0.26 kB
build/client/assets/_index-D_UUquDl.js          0.76 kB │ gzip:  0.39 kB
build/client/assets/root-B_va2Ysy.js            1.44 kB │ gzip:  0.84 kB
build/client/assets/jsx-runtime-BlSqMCxk.js     8.09 kB │ gzip:  3.04 kB
build/client/assets/entry.client-DxOYqYt_.js   14.18 kB │ gzip:  4.94 kB
build/client/assets/components-Bjtzq-Kj.js    212.63 kB │ gzip: 68.80 kB
✓ built in 447ms
vite v5.1.4 building SSR bundle for production...
✓ 5 modules transformed.
build/server/.vite/manifest.json  0.13 kB
build/server/index.js             6.89 kB
✓ built in 14ms
@markdalgleish
Copy link
Member

Fixed by #8965.

Copy link
Contributor

github-actions bot commented Mar 5, 2024

🤖 Hello there,

We just published version 2.8.1-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

github-actions bot commented Mar 7, 2024

🤖 Hello there,

We just published version 2.8.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

No branches or pull requests

3 participants