Open kainstar opened 4 months ago
Start a new pull request in StackBlitz Codeflow.
I'm having the same issue when using the carousel component from shadcn-vue.
Error: Cannot find module /Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/embla-carousel-vue@8.1.7_vue@3.4.33/node_modules/embla-carousel-vue/esm imported from file:///Users/renatomoor/seelo/co-living-davos, file:///Users/renatomoor/seelo/, file:///Users/renatomoor/seelo/co-living-davos/_index.js, file:///Users/renatomoor/seelo/node_modules
at _resolve (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs:2102:19)
at resolveSync (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs:2111:10)
at resolvePathSync (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs:2121:24)
at resolvePath (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs:2125:28)
at isValidNodeImport (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs:2585:30)
at _shouldExternalize (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/server.mjs:78:32)
at shouldExternalize (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/server.mjs:55:19)
at ViteNodeServer.shouldExternalize (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/server.mjs:225:12)
at ViteNodeServer._fetchModule (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/server.mjs:322:36)
at ViteNodeServer.fetchModule (file:///Users/renatomoor/seelo/co-living-davos/node_modules/.pnpm/vite-node@0.34.7/node_modules/vite-node/dist/server.mjs:261:14)
I've overrided to vite-node@2.0.3 but now I have this error in the console:
/Users/renatomoor/seelo/co-living-davos/node_modules/.histoire/plugins/builtin_tailwind-tokens/Tailwind.story.js:1
import 'histoire-style'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1178:20)
at Module._compile (node:internal/modules/cjs/loader:1220:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
I remove the tailwind tokens default plugin for histoire like this for now:
import { tailwindTokens } from 'histoire/src/node/builtin-plugins/tailwind-tokens'
export default defineConfig({
plugins: [
tailwindTokens({
configFile: null,
}),
],
})
We encountered the same issue:
Error while collecting story /home/cespinas/dev/netatmo/onesite/packages/ui/histoire/Banners.story.vue:
Error: Cannot find module /home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/lucide-vue-next@0.453.0_vue@3.5.12_typescript@5.5.4_/node_modules/lucide-vue-next/dist/esm imported from file:///home/cespinas/dev/netatmo/onesite/packages/ui, file:///home/cespinas/dev/netatmo/onesite/packages/, file:///home/cespinas/dev/netatmo/onesite/packages/ui/_index.js, file:///home/cespinas/dev/netatmo/onesite/packages/node_modules
at _resolve (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs:2102:19)
at resolveSync (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs:2111:10)
at resolvePathSync (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs:2121:24)
at resolvePath (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs:2125:28)
at isValidNodeImport (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs:2585:30)
at _shouldExternalize (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/vite-node@0.34.7_@types+node@22.7.8_terser@5.31.6/node_modules/vite-node/dist/server.mjs:78:32)
at shouldExternalize (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/vite-node@0.34.7_@types+node@22.7.8_terser@5.31.6/node_modules/vite-node/dist/server.mjs:55:19)
at ViteNodeServer.shouldExternalize (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/vite-node@0.34.7_@types+node@22.7.8_terser@5.31.6/node_modules/vite-node/dist/server.mjs:225:12)
at ViteNodeServer._fetchModule (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/vite-node@0.34.7_@types+node@22.7.8_terser@5.31.6/node_modules/vite-node/dist/server.mjs:322:36)
at ViteNodeServer.fetchModule (file:///home/cespinas/dev/netatmo/onesite/node_modules/.pnpm/vite-node@0.34.7_@types+node@22.7.8_terser@5.31.6/node_modules/vite-node/dist/server.mjs:261:14)
Have a great day, Colin.
When will that fix be released? Is there a workaround?
Describe the bug
When i import
lucide-vue-next
, histoire report it cannot find module:Reason and solution
After debug, i found it's because histoire using vite-node with a old version 0.34.7 whose latest version is 1.6.0, when i force using vite-node@1.6.0 with pnpm's overrides config, it works.
So is histoire has any play to upgrade vite-node to latest version?
Reproduction
https://stackblitz.com/edit/histoire-vue3-starter-hzthpp?file=src%2Fdemo.story.vue
System Info
Used Package Manager
pnpm
Validations