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

chore(web): add missing dependencies from warnings #6359

Closed
wants to merge 1 commit into from

Conversation

vindard
Copy link

@vindard vindard commented Apr 22, 2024

Description

These changes will allow 'yarn install' to run with an '--immutable' flag which is useful for some build systems like when building in nixpkgs.

Sample error log from nix build:

error: builder for '/nix/store/jb93fk7wjn07k63n7hf6fin3hxypf3n4-yarn-deps.drv' failed with exit code 1;
       last 25 log lines:
       > ➤ YN0000: ┌ Post-resolution validation
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0060---incompatible_peer_dependencyYN00608;;: │ eslint is listed by your project with version 7.32.0, which doesn't satisfy what react-scripts (pe15cc) and other dependencies request (^8.1.0).
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide @babel/core (p19c5b), requested by babel-loader.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide @babel/core (p890ff), requested by @storybook/addon-essentials.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide @babel/core (pe72d4), requested by @storybook/preset-create-react-app.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide @storybook/node-logger (p56567), requested by @storybook/preset-create-react-app.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide react-is (p3e872), requested by styled-components.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependencyYN00028;;: │ tilt-ui@workspace:. doesn't provide require-from-string (p149c8), requested by @storybook/react.
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0086---explain_peer_dependencies_ctaYN00868;;: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
       > ➤ YN0000: │
       > ➤ YN0000: │ @@ -2,9 +2,9 @@
       > ➤ YN0000: │  # Manual changes might be lost - proceed with caution!
       > ➤ YN0000: │  
       > ➤ YN0000: │  __metadata:
       > ➤ YN0000: │    version: 8
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0028---frozen_lockfile_exceptionYN00288;;: │ -  cacheKey: 10
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0028---frozen_lockfile_exceptionYN00288;;: │ +  cacheKey: 10c0
       > ➤ YN0000: │  
       > ➤ YN0000: │  "@aashutoshrathi/word-wrap@npm:^1.2.3":
       > ➤ YN0000: │    version: 1.2.6
       > ➤ YN0000: │    resolution: "@aashutoshrathi/word-wrap@npm:1.2.6"
       > ➤ YN0000: │
       > ➤ 8;;https://yarnpkg.com/advanced/error-codes#yn0028---frozen_lockfile_exceptionYN00288;;: │ The lockfile would have been modified by this install, which is explicitly forbidden.
       > ➤ YN0000: └ Completed
       > ➤ YN0000: · Failed with errors in 0s 399ms

These changes will allow 'yarn install' to run with an '--immutable'
flag which is useful for some build systems like nix.

Signed-off-by: vindard <17693119+vindard@users.noreply.github.com>
@nicks
Copy link
Member

nicks commented Apr 23, 2024

Hmmm...our ci already runs with --immutable:

tilt/Makefile

Line 80 in 37e0a52

cd web && yarn install --immutable

So I'm a bit confused about what the difference is in your nix env.

Most of this PR is adding dev dependencies as library dependencies, which doesn't seem right...

@vindard
Copy link
Author

vindard commented Apr 23, 2024

Ah you're right. It was a YARN_COMPRESSION_LEVEL in my build that was causing the lockfile to mutate, not these dependencies. Closing as resolved, thanks for checking this

@vindard vindard closed this Apr 23, 2024
@vindard vindard deleted the fix-web-deps branch April 23, 2024 16:53
@vindard
Copy link
Author

vindard commented Apr 23, 2024

For context, this is what I was working on. The update to yarn berry broke fetchYarnDeps for the normal upgrade path in nixpkgs for tilt so I had to change how this is done a bit

NixOS/nixpkgs#306333

Edit: My approach wasn't reproducible across Linux and Darwin systems. This means that until someone figures out a different way to build yarn deps with yarn-berry lockfile format for nix, the nix version will be stuck at 0.3.11 for the latest (cc @nicks as an fyi)

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

Successfully merging this pull request may close these issues.

2 participants