Skip to content

rtsao/vite-bug-repro-ssr-pnp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-bug-repro-ssr-pnp

A reproduction of broken SSR with CommonJS dependencies and Yarn PnP.

app (a workspace) depends on pkg-a (another workspace) which depends on locale (a CommonJS npm dependency).

SSR crashes with ReferenceError: module is not defined from locale.

Reproduction steps:

corepack enable
yarn install
yarn node app/server.mjs
open http://localhost:5173

Note that this does not error without PnP:

corepack enable
yarn config set nodeLinker node-modules
yarn install
yarn node app/server.mjs
open http://localhost:5173

It is also worth noting that this does not error if the npm CJS package is a direct dependency of app.

About

A reproduction of broken SSR with CommonJS dependencies and Yarn PnP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published