hipstersmoothie / react-docgen-typescript-plugin

A webpack plugin to inject react typescript docgen information
MIT License
68 stars 28 forks source link

Issues with canary package name length #65

Open curtvict opened 2 years ago

curtvict commented 2 years ago

image

Has anyone else experienced issues with this long canary name? At least one of my teammates has hit this error:

➤ YN0000: └ Completed in 0s 843ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ @storybook/react-docgen-typescript-plugin@npm:1.0.2-canary.6.9d540b91e815f
➤ YN0001: │ Error: @storybook/react-docgen-typescript-plugin@npm:1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0: ENAMETOOLONG: name too long, copyfile '/tmp/some/path/archive.zip' -> '/home/some/path/.yarn/cache/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40-91a3015d38.zip-ab77634ccf8aae0f.tmp'
➤ YN0000: └ Completed in 1s 358ms
➤ YN0000: Failed with errors in 2s 205ms

They were forced to downgrade to 1.0.1 to get around their issue.

If there is no specific reason for the change in naming I vote going back to the shortened SHA version as seen in previous canary releases:

image

imnotjames commented 2 years ago

For me this seems to be an issue with ecryptfs. FNEK - Encrypted filenames - have a limit of 143 characters long.

This seems to be because storybook/react is pulling in the canary

curtvict commented 2 years ago

Ah, I just confirmed with my teammate that they were running ecryptfs. I'm running LUKS so that could make sense why I wasn't seeing it myself.

z0ccc commented 2 years ago

Is there a quick fix for this or do you have to switch from ecryptfs?

rogix commented 2 years ago

I'am facing a similar problem:

Arguments: 
  /home/username/.nvm/versions/node/v14.17.5/bin/node /home/username/.yarn/bin/yarn.js add -D --ignore-workspace-root-check @storybook/react@^6.5.6 @storybook/addon-links@^6.5.6 @storybook/addon-essentials@^6.5.6 @storybook/addon-actions@^6.5.6 @storybook/addon-interactions@^6.5.6 @storybook/testing-library@^0.0.11 @storybook/builder-webpack4@^6.5.6 @storybook/manager-webpack4@^6.5.6 @babel/core@^7.18.2 babel-loader@^8.2.5

PATH: 
  /home/username/code/personal/open-source/some/project/node_modules/.bin:/home/username/code/personal/open-source/some/node_modules/.bin:/home/username/code/personal/open-source/node_modules/.bin:/home/username/code/personal/node_modules/.bin:/home/username/code/node_modules/.bin:/home/username/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/username/.nvm/versions/node/v14.17.5/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/username/.npm/_npx/6fe9a9991b157df1/node_modules/.bin:/home/username/.yarn/bin:/home/username/.config/yarn/global/node_modules/.bin:/home/username/.yarn/bin:/home/username/.config/yarn/global/node_modules/.bin:/home/username/.zinit/polaris/bin:/home/username/.nvm/versions/node/v14.17.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Yarn version: 
  1.22.17

Node version: 
  14.17.5

Platform: 
  linux x64

Trace: 
  Error: ENAMETOOLONG: name too long, unlink '/home/username/.cache/yarn/v6/npm-@storybook-react-docgen-typescript-plugin-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-3103532ff494fb7dc3cf835f10740ecf6a26c0f9-integrity/node_modules/@storybook/react-docgen-typescript-plugin'

Did anyone here find some solution for this issue other than remove ecryptfs?

Edit: for clarification, this happens when I try to install storybook on a new project, just running: npx storybook init

rogix commented 2 years ago

In case someone need this. A work around for this issue was moving the yarn cache out of the /home directory.

https://github.com/storybookjs/storybook/discussions/18441

imnotjames commented 2 years ago

To work around this, I downgraded to 1.0.1 by setting a yarn resolution policy.

https://yarnpkg.com/cli/set/resolution/

But a shorter package version would be ideal -- or not using the canary version by default.

rogix commented 2 years ago

Cool! I didn't know how to do this.

Fadoli commented 2 years ago

Having the issue, if either your yarn cache or your working directory is in an encrypted folder, the path name will NOT allow you to use the latest "canary" version of this package.

Please can you do a new release with a reasonable name length @hipstersmoothie ?

hipstersmoothie commented 2 years ago

Not sure why that package name is so long. Really question is why is someone using the canary version?

dbouclier commented 2 years ago

story book react package (https://www.npmjs.com/package/@storybook/react)

is explicitly using it https://github.com/storybookjs/storybook/blob/main/app/react/package.json ( "@storybook/react-docgen-typescript-plugin": "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0",)

this 'canary version' should not be used ? in that case the issue should be reported to storybook ?

a workaround if you get this "ENAMETOOLONG: name too long" error

in package.json add this :

  "resolutions": {
    "@storybook/react-docgen-typescript-plugin": "1.0.1"
  },