I am attempting to find why I get window not defined errors in my worker files. In order to make sure this is an error that is specific to my codebase, I am attempting to run the worker project in playgrounds.
With NodeJS v20.15 and latest pnpm, I am running the following commands:
git clone git@github.com:vitejs/vite-plugin-react-swc.git
cd vite-plugin-react-swc
pnpm i
cd playground/worker
pnpm i
pnpm run dev
However, I receive this error:
> playground-worker@ dev /Users/rgasparini/Code/vite-plugin-react-swc/playground/worker
> vite
failed to load config from /Users/rgasparini/Code/vite-plugin-react-swc/playground/worker/vite.config.ts
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@vitejs/plugin-react-swc' imported from /Users/rgasparini/Code/vite-plugin-react-swc/playground/worker/vite.config.ts.timestamp-1718945480134-795d62d080e2b.mjs
at packageResolve (node:internal/modules/esm/resolve:854:9)
at moduleResolve (node:internal/modules/esm/resolve:927:18)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
at link (node:internal/modules/esm/module_job:86:36)
ELIFECYCLE Command failed with exit code 1.
Is there any documentation other than the README that I am missing?
I am attempting to find why I get
window not defined
errors in my worker files. In order to make sure this is an error that is specific to my codebase, I am attempting to run the worker project in playgrounds.With NodeJS v20.15 and latest
pnpm
, I am running the following commands:However, I receive this error:
Is there any documentation other than the README that I am missing?