Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jul 27, 2025

Description

Just a slight reassurance to avoid entirely cryptic ReferenceError: module is not defined server error.

Example when removing this line (explicit include example added by #611)

'@vitejs/test-dep-transitive-cjs > use-sync-external-store/shim/index.js',

7:14:05 PM [vite] (ssr) warning: [vite-rsc] found non-optimized CJS dependency in 'ssr' environment. It is recommended to manually add the dependency to 'environments.ssr.optimizeDeps.include'.
  Plugin: rsc:detect-non-optimized-cjs
  File: /home/hiroshi/code/others/vite-plugin-react/node_modules/.pnpm/[email protected][email protected]/node_modules/use-sync-external-store/shim/index.js?v=5b54ec8a
image

TODO

  • test
  • option (enabled by default)
  • transform cjs into esm on the fly (later)

@hi-ogawa hi-ogawa changed the title feat(rsc): show warning when non optimized cjs is found feat(rsc): show warning for non optimized cjs Jul 27, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review July 27, 2025 10:22
@hi-ogawa hi-ogawa merged commit da0a786 into main Jul 28, 2025
20 checks passed
@hi-ogawa hi-ogawa deleted the 07-27-feat_rsc_show_warning_when_non_optimized_cjs_is_found branch July 28, 2025 01:34
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.

2 participants