Closed tukanoidd closed 9 months ago
Also encountering this issue with a blank (just scaffolded) Vuetify project.
It works if you exclude the extension option from vite.config.ts. But I don't know why.
// vite.config.ts
...
define: { 'process.env': {} },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
// extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
},
server: {
port: 3000,
},
...
It works if you exclude the extension option from vite.config.ts. But I don't know why.
// vite.config.ts ... define: { 'process.env': {} }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, // extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'], }, server: { port: 3000, }, ...
@Seungwoo321 It works, but be cautious with in-progress projects. If you exclude the extension option, you may need to refactor your entire code, meaning every import extension.
Removing extensions works because Vite's default extensions
value is:
['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
The important part here is .mjs
needs to come before .js
Otherwise it resolves the commonjs file in the same folder.
closing as dupe to https://github.com/storybookjs/storybook/issues/24792
Describe the bug
Initialized storybook with
init
in existing vue3 + vuetify + vite + ts project, the example generated byinit
mostly works, except for the "Configure your project".mdx
file, all I'm getting is (the errors before "vite connected" are from firefox extensions) I tried to look for information on this but couldn't find anything.What I've tried:
Package Managers
NPM - 10.1.0 Yarn - 1.22.19 | 3.6.4 Bun - 1.0.13
Runtimes
NodeJS - 18.18.2 | 20.9.0 Bun - 1.0.13
Others
Sadly, nothing worked
To Reproduce
npx storybook init
System
Additional context
package.json
tsconfig.json
vite.config.ts