Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dean-g opened this issue Jul 11, 2022 · 8 comments

Comments

@dean-g
Copy link

dean-g commented Jul 11, 2022

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

@mandarini
Copy link
Contributor

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??

@mlegait
Copy link

mlegait commented Sep 17, 2022

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 😄

b12f pushed a commit to opf/openproject that referenced this issue Nov 2, 2022
Storybook assets cannot currently be loaded by merging directories,
so this fix makes sure files are loaded individually.

storybookjs/storybook#18686
b12f pushed a commit to opf/openproject that referenced this issue Nov 2, 2022
Both Lato and the icon font were not loading correctly since the CSS
expects them to be available under a certain URL. This URL is available
in the core app, but not storybook. This commit makes sure the assets
load correctly in Storybook, giving us pretty icons and the right font.

Storybook assets cannot currently be loaded by merging directories,
so this fix makes sure files are loaded individually.

storybookjs/storybook#18686
@lucas-labs
Copy link

lucas-labs commented Jan 30, 2023

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']

@nodesmichael
Copy link

Same

@zenby
Copy link

zenby commented Mar 5, 2023

Have the same issue

@shilman shilman added core and removed needs triage labels Mar 15, 2023
@MadebyAe
Copy link

Same... Any work around?

@zenby
Copy link

zenby commented Apr 18, 2023

Same... Any work around?

bump storybook to 7th version

@duhem-s
Copy link

duhem-s commented Jun 23, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants