adiun / vite-monorepo

Example Vite monorepo with Typescript, NPM 7 Workspaces, and Storybook
175 stars 33 forks source link

what part of this repo makes npm7 workspace possible? #2

Closed mesqueeb closed 3 years ago

mesqueeb commented 3 years ago

hey! I'm looking through the repo, but I cannot find exactly which config enables npm 7 workspaces.

I currently get this error in our repo:

 [vite] hmr update /src/App.vue
[web-auth-redirect] 5:13:53 PM [vite] Internal server error: Failed to resolve entry for package "@cc/web-auth-redirect". The package may have incorrect main/module/exports specified in its package.json.
[web-auth-redirect]   Plugin: vite:import-analysis

any ideas?

mesqueeb commented 3 years ago

nevermind! I had a typo : P

Katona commented 3 years ago

Hi @mesqueeb! What was the error? I have the same problem when I run npm start in the app module.

Katona commented 3 years ago

Actually, not the same, but similar:

error when starting dev server:
Error: Build failed with 1 error:
../node_modules/vite/dist/node/chunks/dep-0ed4fbc0.js:32628:14: error: [plugin: vite:dep-scan] Failed to resolve entry for package "@adiun/vm-coreui". The package may have incorrect main/module/exports specified in its package.json.
    at failureErrorWithLog (/Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:1449:15)
    at /Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:1131:28
    at runOnEndCallbacks (/Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:921:63)
    at buildResponseToResult (/Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:1129:7)
    at /Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:1236:14
    at /Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:609:9
    at handleIncomingPacket (/Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:706:9)
    at Socket.readFromStdout (/Users/katona/work/learn/vite-monorepo/node_modules/esbuild/lib/main.js:576:7)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:315:12)
mesqueeb commented 3 years ago

@Katona IIRC i had written the wrong package name either in package.json or where I imported it. Don't remember which one.