storybook icon indicating copy to clipboard operation
storybook copied to clipboard

staticDirs config fails on ci/cd pipeline ([Error: EEXIST: file already exists, mkdir /builds/dist/storybook/stories/assets)

Open dean-g opened this issue 2 years ago • 5 comments

My story book is failing with the following error after I moved my asset to staticDirs,

staticDirs: [
    { from: '../../../src/assets', to: 'assets' },
  ],

info => Using angular project with "tsConfig:/builds/libs/stories/.storybook/tsconfig.json"
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^
[Error: EEXIST: file already exists, mkdir '/builds/dist/storybook/stories/assets'] {
  errno: -17,
  code: 'EEXIST',
  syscall: 'mkdir',
  path: '/builds/dist/storybook/stories/assets'
}

storybook version is: "@nrwl/storybook": "14.3.6",

Is there a way to copy the file instead of mkdir ?

Please advise

dean-g avatar Jul 11 '22 16:07 dean-g

I believe that this is not an issue with Nx, since Nx is invoking the @storybook/angular builder directly, this is the reason why I suggested to @dean-g to open the issue here, on the Storybook repo, instead. @shilman do you see anything that may suggest what the problem may be? Or any tips on how I could help??

mandarini avatar Jul 22 '22 08:07 mandarini

Hello 👋

I was also wondering if it could be possible not to fail if the directory already exists. I would like to be able to do something like that:

staticDirs: [
  {from: './assets', to: 'assets/'},
  {from: '../../static-conf/common/icons/tails', to: 'assets/icons/tails'} ,
  {from: '../../static-conf/common/icons/common', to: 'assets/icons/all'},
  {from: '../../static-conf/taer/icons/custom', to: 'assets/icons/all'},
]

It works quite well when I launch Storybook locally but as soon as I want to build it in order to deploy it, it fails because of the error @dean-g mentioned above: Error: EEXIST: file already exists, mkdir ...

Being able to do that would be really helpful for the project I'm working on 😄

mlegait avatar Sep 17 '22 06:09 mlegait

Same error here.

staticDirs: [
  {
    from: "./../assets",
    to: "assets/"
  },
  {
    from: "./../node_modules/@internal/icon-font",
    to: "assets/fonts"
  }
]

It works ok while serving it locally, but fails when trying to build

[Error: EEXIST: file already exists, mkdir '[REDACTED]/dist/storybook/ds/assets']

lucas-labs avatar Jan 30 '23 19:01 lucas-labs

Same

nodesmichael avatar Feb 07 '23 12:02 nodesmichael

Have the same issue

zenby avatar Mar 05 '23 15:03 zenby

Same... Any work around?

MadebyAe avatar Apr 18 '23 03:04 MadebyAe

Same... Any work around?

bump storybook to 7th version

zenby avatar Apr 18 '23 08:04 zenby

Same... Any work around?

bump storybook to 7th version

I did try to upgrade to version 7 but for other reasons my storybook is not working anymore.

There is no way to fix this in version 6 ?

duhem-s avatar Jun 23 '23 15:06 duhem-s