Open miclgael opened 1 year ago
Getting the issue as well
Hi @daniellacosse - any chance you could do up a reproduction? Not sure what I was doing wrong :3
I'm not using Storybook, but I have this exact same issue with a Nuxt 3 programmatic build.
I have a working version (a "reproduction") and a non-working version (my app). Both builds work without the content module.
The difference seems to be tsconfig.server.json
.
tsconfig.server.json - not working
"#mdc-imports": [
"./file:/home/michael/causing-us/friend-server/.quasar/electron/baseLayer/.nuxt/mdc-imports"
],
tsconfig.server.json - working
"#mdc-imports": [
"./mdc-imports"
],
Not sure how to debug this. Why does it use a file: protocol?
I'm getting the same error with my project which is using Nuxt Content and Nuxt UI Pro. I can reproduce it by installing the nuxt-ui-pro saas template (https://github.com/nuxt-ui-pro/saas) with npx nuxi init -t github:nuxt-ui-pro/saas
and then doing the standard storybook install.
You'll need a NUXT_UI_PRO_LICENSE to create a production build so maybe the nuxt ui guys can get you one to test it out. I don't think the error is UI Pro though, I think it's Content because of the MDC component.
Just thought you could try this as a repro. Might even be able to use Content Wind to see the error, https://github.com/atinux/content-wind
So I just quickly confirmed the Content Wind has the same issue.
Easy repro:
npx nuxi@latest init -t themes/content-wind my-website
npm install -D @nuxtjs/storybook
// edit nuxt.config.js
export default defineNuxtConfig(
{
modules: ['@nuxtjs/storybook']
})
npx storybook-nuxt init
pnpm run storybook
[nitro 5:58:07 p.m.] ERROR Error: Could not load file:///home/richard/skunkworks/my-website/.nuxt/mdc-imports.mjs (imported by node_modules/.pnpm/@nuxtjs+mdc@0.3.2/node_modules/@nuxtjs/mdc/dist/runtime/parser/index.mjs): ENOENT: no such file or directory, open 'file:///home/richard/skunkworks/my-website/.nuxt/mdc-imports.mjs'
undefined
=> Failed to build the preview
Error: Error: Could not load file://./.nuxt/mdc-imports.mjs (imported by node_modules/.pnpm/@nuxtjs+mdc@0.3.2/node_modules/@nuxtjs/mdc/dist/runtime/parser/index.mjs): ENOENT: no such file or directory, open 'file://./.nuxt/mdc-imports.mjs'
at defineNuxtConfig (./node_modules/.pnpm/@storybook-vue+nuxt@0.2.1_@types+node@18.19.8_nuxt@3.9.3_vite@5.0.12_vue@3.3.13/node_modules/@storybook-vue/nuxt/dist/preset.cjs:6676:11)
at async Object.viteFinal (./node_modules/.pnpm/@storybook-vue+nuxt@0.2.1_@types+node@18.19.8_nuxt@3.9.3_vite@5.0.12_vue@3.3.13/node_modules/@storybook-vue/nuxt/dist/preset.cjs:6697:22)
at async createViteServer (./node_modules/.pnpm/@storybook+builder-vite@7.6.7_typescript@5.3.3_vite@5.0.12/node_modules/@storybook/builder-vite/dist/index.js:159:10562)
at async Module.start (./node_modules/.pnpm/@storybook+builder-vite@7.6.7_typescript@5.3.3_vite@5.0.12/node_modules/@storybook/builder-vite/dist/index.js:159:12804)
WARN Broken build, fix the error above.
WARN You may need to refresh the browser.
Hope this helps
Hello, and thank you for taking initiative in this module!
My set-up includes Nuxt Content, and produces this error on macOS 12.2.1 (21D62) Monterey
Things tried
mdc
in Nuxt Content, but this didn't help.