storybookjs / addon-react-native-web

Build react-native-web projects in Storybook for React
MIT License
83 stars 24 forks source link

watchpack-chokidar2 seems to be throwing error on install in CI #65

Closed Coffeegerm closed 1 year ago

Coffeegerm commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Our CI pipeline has been hitting a snag with chokidar2 and fsevents when installing from yarn.

yarn install v1.22.19
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
warning Pattern ["prop-types@latest"] is trying to unpack in the same destination "/Users/distiller/Library/Caches/Yarn/v6/npm-prop-types-15.7.2-integrity/node_modules/prop-types" as pattern ["prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.6.2","prop-types@^15.7.2","prop-types@^15.6.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.6.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2","prop-types@^15.7.2"]. This could result in non-deterministic behavior, skipping.
[4/5] 🔗  Linking dependencies...
warning " > react-hook-form@7.6.7" has incorrect peer dependency "react@^16.8.0 || ^17".
warning "react-native > react-native-codegen > jscodeshift@0.13.1" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning " > react-native-config-encrypted@1.0.2" has incorrect peer dependency "react@^16.13.0".
warning " > react-native-config-encrypted@1.0.2" has incorrect peer dependency "react-dom@^16.13.0".
warning " > react-native-markdown-display@7.0.0-alpha.2" has incorrect peer dependency "react@^16.2.0".
warning " > react-native-tab-view@3.1.1" has unmet peer dependency "react-native-pager-view@*".
warning " > styled-components@5.2.1" has unmet peer dependency "react-is@>= 16.8.0".
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning "@react-native-community/eslint-config > @typescript-eslint/parser@2.34.0" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
warning "@react-native-community/eslint-config > eslint-plugin-react@7.19.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "@react-native-community/eslint-config > eslint-plugin-react-hooks@3.0.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "@react-native-community/eslint-config > eslint-plugin-react-native@3.8.1" has incorrect peer dependency "eslint@^3.17.0 || ^4 || ^5 || ^6".
warning "@storybook/addon-actions > react-inspector@5.1.1" has incorrect peer dependency "react@^16.8.4 || ^17.0.0".
warning " > @storybook/addon-ondevice-controls@6.5.3" has incorrect peer dependency "@storybook/addon-controls@^6.5.14".
warning "@storybook/addon-ondevice-controls > @emotion/native > @emotion/primitives-core@10.0.27" has unmet peer dependency "@emotion/core@^10.0.27".
warning "@storybook/react-native > @storybook/core-client@6.5.16" has unmet peer dependency "webpack@*".
warning " > @storybook/react-native-server@6.5.3" has unmet peer dependency "webpack@^4 || ^5".
warning "@storybook/react-native-server > @storybook/core@6.5.16" has unmet peer dependency "webpack@*".
warning " > @testing-library/react-hooks@8.0.0" has incorrect peer dependency "react@^16.9.0 || ^17.0.0".
warning " > babel-loader@8.2.5" has unmet peer dependency "webpack@>=2".
warning " > detox@17.14.9" has unmet peer dependency "jest-circus@26.0.x - 26.4.x || >=26.5.2".
warning " > detox@17.14.9" has unmet peer dependency "jest-environment-node@>=25.0.0".
warning " > detox@17.14.9" has unmet peer dependency "mocha@>=6.0.0".
warning " > react-dom@17.0.2" has incorrect peer dependency "react@17.0.2".
warning "react-test-renderer > react-shallow-renderer@16.14.1" has incorrect peer dependency "react@^16.0.0 || ^17.0.0".
warning " > reactotron-react-query@1.0.2" has unmet peer dependency "react-query@^3.39.2".
warning " > reactotron-react-query@1.0.2" has unmet peer dependency "reactotron-core-client@^2.5.0".
warning "workspace-aggregator-f186c109-0a63-4487-acce-b3e89c6f3f0a > pb-tw > twrnc > tailwindcss@3.1.6" has unmet peer dependency "postcss@^8.0.9".
[5/5] 🔨  Building fresh packages...
warning Error running install script for optional dependency: "/Users/distiller/project/node_modules/watchpack-chokidar2/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /Users/distiller/project/node_modules/watchpack-chokidar2/node_modules/fsevents
Output:
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ]
}"
info This module is OPTIONAL, you can safely ignore this error
info This package requires node-gyp, which is not currently installed. Yarn will attempt to automatically install it. If this fails, you can run "yarn global add node-gyp" to manually install it.
error An unexpected error occurred: "/Users/distiller/project/node_modules/husky: Cannot read properties of undefined (reading 'config')".
info If you think this is a bug, please open a bug report with the information provided in "/Users/distiller/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Installed "node-gyp@9.4.0" with binaries:
      - node-gyp

Exited with code exit status 1
CircleCI received exit code 1

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Error does not occur in local development, but has started happening recently on our CI steps.

Expected behavior A clear and concise description of what you expected to happen.

Chokidar2 should not throw errors on install in our CI pipeline

Screenshots If applicable, add screenshots to help explain your problem.

Code snippets If applicable, add code samples to help explain your problem.

System: Please paste the results of npx -p @storybook/cli@next sb info here.

Environment Info:

System: OS: macOS 13.4 CPU: (10) x64 Apple M1 Pro Binaries: Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm Browsers: Chrome: 114.0.5735.133 Safari: 16.5 npmPackages: @storybook/addon-actions: ^6.5.16 => 6.5.16 @storybook/addon-controls: ^7.0.9 => 7.0.9 @storybook/addon-links: ^7.0.9 => 7.0.9 @storybook/addon-ondevice-actions: ^6.5.3 => 6.5.3 @storybook/addon-ondevice-backgrounds: ^6.5.3 => 6.5.3 @storybook/addon-ondevice-controls: ^6.5.3 => 6.5.3 @storybook/addon-ondevice-notes: ^6.5.3 => 6.5.3 @storybook/addons: ^7.0.9 => 7.0.9 @storybook/react-native: ^6.5.3 => 6.5.3 @storybook/react-native-server: ^6.5.3 => 6.5.3

Additional context Add any other context about the problem here.

Our CI pipeline is occuring on mac machine for iOS builds

dannyhw commented 1 year ago

doesn't look like a storybook issue, can you confirm?

dannyhw commented 1 year ago

seems like multiple issues around this regarding yarn and node so I would try clearing cache and regenerating the lock file

dannyhw commented 1 year ago

Also I wouldn't recommend mixing version 7 storybook with version 6, better to put everything to 6.5

ckhatton-transreport commented 1 year ago

Na, I'm afraid running yarn cache clean didn't solve the issue. Any other thoughts?

ckhatton-transreport commented 1 year ago

I have found you have to force a fsevents upgrade in the package.json:

"resolutions": {
  "**/**/fsevents": "^2.3.3"
}