vitejs / vitejs/vite-plugin-react

`Sourcemap is likely to be incorrect` warnings on `vite build --sourcemap`

Open
#1,122 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage plugin: rsc
Dominant language
TypeScript
Stars
1.2k
Forks
269
Avg merge
1d 3h
Merged PRs (30d)
19

Description

Related plugins
Describe the bug
$ pnpm -C packages/plugin-rsc/examples/starter build --sourcemap

> @vitejs/plugin-rsc-examples-starter@0.0.0 build /home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter
> vite build --sourcemap

[1/5] analyze client references...
vite v7.3.1 building rsc environment for production...
✓ 55 modules transformed.
[plugin rsc:virtual:vite-rsc/assets-manifest] Sourcemap is likely to be incorrect: a plugin (rsc:virtual:vite-rsc/assets-manifest) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
✓ built in 336ms
[2/5] analyze server references...
vite v7.3.1 building ssr environment for production...
✓ 50 modules transformed.
[plugin rsc:virtual:vite-rsc/assets-manifest] Sourcemap is likely to be incorrect: a plugin (rsc:virtual:vite-rsc/assets-manifest) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
✓ built in 267ms
[3/5] build rsc environment...
vite v7.3.1 building rsc environment for production...
✓ 55 modules transformed.
[plugin vite:reporter] 
(!) /home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/action.tsx is dynamically imported by virtual:vite-rsc/server-references but also statically imported by /home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/root.tsx, dynamic import will not move module into another chunk.

[plugin rsc:inject-async-local-storage] Sourcemap is likely to be incorrect: a plugin (rsc:inject-async-local-storage) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
[plugin rsc:inject-async-local-storage] Sourcemap is likely to be incorrect: a plugin (rsc:inject-async-local-storage) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help (x2)
[plugin rsc:virtual:vite-rsc/assets-manifest] Sourcemap is likely to be incorrect: a plugin (rsc:virtual:vite-rsc/assets-manifest) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
dist/rsc/assets/react-CHdo91hT.svg    4.13 kB
dist/rsc/assets/index-NeOOZrmx.css    1.40 kB
dist/rsc/index.js                   626.79 kB │ map: 14.28 kB
✓ built in 647ms
[4/5] build client environment...
vite v7.3.1 building client environment for production...
✓ 42 modules transformed.
[plugin rsc:vite-client-raw-import] Sourcemap is likely to be incorrect: a plugin (rsc:vite-client-raw-import) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
dist/client/assets/react-CHdo91hT.svg       4.13 kB │ gzip:  2.05 kB
dist/client/assets/index-NeOOZrmx.css       1.40 kB │ gzip:  0.71 kB
dist/client/assets/entry.rsc-JZAVNEuk.js    0.27 kB │ gzip:  0.24 kB │ map:     0.59 kB
dist/client/assets/index-DPERZMr6.js      222.96 kB │ gzip: 70.55 kB │ map: 1,034.11 kB
✓ built in 478ms
[5/5] build ssr environment...
vite v7.3.1 building ssr environment for production...
✓ 51 modules transformed.
[plugin rsc:virtual:vite-rsc/assets-manifest] Sourcemap is likely to be incorrect: a plugin (rsc:virtual:vite-rsc/assets-manifest) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
[plugin rsc:inject-async-local-storage] Sourcemap is likely to be incorrect: a plugin (rsc:inject-async-local-storage) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
[plugin rsc:inject-async-local-storage] Sourcemap is likely to be incorrect: a plugin (rsc:inject-async-local-storage) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help (x2)
[plugin rsc:virtual:vite-rsc/assets-manifest] Sourcemap is likely to be incorrect: a plugin (rsc:virtual:vite-rsc/assets-manifest) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
dist/ssr/assets/entry.rsc-DMKK0oJ_.js      0.54 kB │ map:  0.12 kB
dist/ssr/index.js                      1,560.08 kB │ map: 32.68 kB
✓ built in 745ms
Reproduction

see above

Steps to reproduce

No response

System Info
na
Used Package Manager

npm

Logs

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running pnpm -C packages/plugin-rsc/examples/starter build --sourcemap and inspect the plugin-rsc transformations named in the output: virtual:vite-rsc/assets-manifest, inject-async-local-storage, and vite-client-raw-import. Trace the related plugin entry points and compare their transformations with Vite's sourcemap expectations. Done means the reproduced build no longer emits incorrect-sourcemap warnings and the generated maps remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.