@nuxtjs/storybook: 4.0.2
nuxt: 2.15.4
Try to deploy to Netlify with:
Have no static folder in your repo, then deploy to Netlify.
npm install --save-dev @nuxtjs/storybook
// Then:
Build command: npx nuxt storybook build
Publish directory: storybook-static
Successfully build of Storybook deployed.
1:03:00 AM: info @nuxtjs/storybook v4.0.2
1:03:00 AM: info
1:03:00 AM: info => Cleaning outputDir: /opt/build/repo/storybook-static
1:03:00 AM: ERR! Failed to load static files, no such directory: /opt/build/repo/static
1:03:00 AM: ERR! Make sure this directory exists, or omit the -s (--static-dir) option.
1:03:00 AM: [fatal] Failed to run command `nuxt-storybook`:
1:03:00 AM: Error: Command failed with exit code 255: nuxt-storybook build
1:03:00 AM:
1:03:00 AM:
1:03:00 AM: โ โ
1:03:00 AM: โ โ Nuxt Fatal Error โ
1:03:00 AM: โ โ
1:03:00 AM: โ Failed to run command `nuxt-storybook`: โ
1:03:00 AM: โ Error: Command failed with exit code 255: nuxt-storybook build โ
1:03:00 AM: โ โ
1:03:00 AM:
I'm not sure if my case related but I got a quite similar error on Vercel but with the additional information of missing vue-loader. @lihbr could that be related to #252 where vue-loader got mentioned?
The problem came after upgrading from v3 to 4.0.2
07:24:40.645 | ERR! Module not found: Error: Can't resolve 'vue-loader' in '/vercel/path0'
07:24:40.664 | ERR! ModuleNotFoundError: Module not found: Error: Can't resolve 'vue-loader' in '/vercel/path0'
// ...
07:24:40.665 | ERR! ModuleNotFoundError: Module not found: Error: Can't resolve 'vue-loader' in '/vercel/path0'
// ...
07:24:40.743 | Error: Command failed with exit code 1: nuxt-storybook build
// ...
07:24:40.748 | โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
07:24:40.748 | โ โ
07:24:40.748 | โ โ Nuxt Fatal Error โ
07:24:40.748 | โ โ
07:24:40.748 | โ Failed to run command `nuxt-storybook`: โ
07:24:40.748 | โ Error: Command failed with exit code 1: nuxt-storybook build โ
07:24:40.749 | โ โ
07:24:40.749 | โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
07:24:40.767 | Error: Command "npx nuxt storybook build" exited with 1
Hey, not sure but try deleting your lock file & node modules to give it a fresh install, Storybook often mess up at module resolution when upgrading~
If that still doesn't work this will need investigation.
@lihbr I deleted lock and modules dir, same error still. My package file if you're curious:
{
"name": "storybook-nuxt",
"engines": {
"node": "14.15.4"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"generate": "nuxt generate",
"start": "nuxt start",
"storybook": "nuxt storybook",
"storybook-build": "nuxt storybook build"
},
"dependencies": {
"nuxt": "^2.15.4"
},
"devDependencies": {
"@nuxtjs/storybook": "^4.0.2",
"@nuxtjs/style-resources": "^1.0.0",
"core-js": "^3.11.0",
"eslint": "^7.25.0",
"eslint-plugin-vue": "^7.9.0",
"node-sass": "^5.0.0",
"prettier": "^2.2.1",
"prettier-eslint": "^12.0.0",
"sass-loader": "^10.1.1",
"vue-svg-loader": "^0.16.0",
"vue-template-compiler": "^2.6.12",
"webfontloader": "^1.6.28"
}
}
OK I figured this out!
It was because I had an empty /static folder in my local repo, which meant in GitHub there was no static folder.
So it turns out this module needs a /static folder to work? I think that is still a bug that probably should be fixed, so I'll leave this open.
Oh nice catch! It's quite unlikely that you end up with an empty static folder with Nuxt (you might want at least a favicon.ico or robots.txt?) but maybe a valid bug? @farnabaz
Yeah our use case is a as a components library, and we have it running in Nuxt so that we get all the mocks of nuxt-link, fetch etc...
Hey, not sure but try deleting your lock file & node modules to give it a fresh install, Storybook often mess up at module resolution when upgrading~
Omg, lol, works for me now. Thanks @lihbr!
Thank you for the issue
Module should simply ignore static dir if it does not exists. This will fix in the next version https://github.com/nuxt-community/storybook/pull/277
Most helpful comment
Yeah our use case is a as a components library, and we have it running in Nuxt so that we get all the mocks of nuxt-link, fetch etc...