Skip to content

Conversation

@gabebohlmann
Copy link

@gabebohlmann gabebohlmann commented May 24, 2025

Vercel is not allowing me to override the yarn version to be v4.5.0 as is necessary to deploy this repo. I set the install command to yarn set version 4.5.0 && yarn install but it uses v4.9.1 anyway. On Vercel yarn set version stable resolves to v4.9.1, so I updated the repo's corepack configuration to that and it works. If there is a Vercel setting I have missed to force v4.5.0 let me know. I also corrected the Vercel deployment settings in the readme. A full guide to reproducing and fixing the issue is below.

Steps to reproduce

  1. Fork main

  2. Clone the fork locally

  3. Attempt to deploy on Vercel without any changes

  4. Failure: Vercel is using yarn v4.9.1, but the repo is set to use yarn v4.5.0 with its corepack config

      [11:36:00.034] Running build in Washington, D.C., USA (East) – iad1
      [11:36:00.034] Build machine configuration: 2 cores, 8 GB
      [11:36:00.048] Cloning github.com/gabebohlmann/starter-free (Branch: main, Commit: 03866cb)
      [11:36:00.812] Cloning completed: 762.000ms
      [11:36:06.052] Restored build cache from previous deployment (CZQZHbK5zQUvxeLY79rf2wudPNck)
      [11:36:07.635] Running "vercel build"
      [11:36:08.084] Vercel CLI 42.1.1
      [11:36:08.234] > Detected Turbo. Adjusting default settings...
      [11:36:08.738] Running "install" command: `yarn set version 4 && yarn install`...
      [11:36:09.692] ➤ YN0000: Downloading https://repo.yarnpkg.com/4.9.1/packages/yarnpkg-cli/bin/yarn.js
      [11:36:09.872] ➤ YN0000: Saving the new release in ../../.yarn/releases/yarn-4.9.1.cjs
      [11:36:09.886] ➤ YN0000: Done in 0s 195ms
      [11:36:10.641] ➤ YN0000: · Yarn 4.9.1
      [11:36:10.642] ➤ YN0000: ┌ Project validation
      [11:36:10.642] ➤ YN0057: │ expo-app: Resolutions field will be ignored
      [11:36:10.642] ➤ YN0000: └ Completed
      [11:36:10.650] ➤ YN0000: ┌ Resolution step
      [11:36:11.413] ➤ YN0085: │ + typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5
      [11:36:11.414] ➤ YN0085: │ - typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=8c6c40
      [11:36:11.513] ➤ YN0000: └ Completed in 0s 862ms
      [11:36:11.515] ➤ YN0000: ┌ Post-resolution validation
      [11:36:11.515] ➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
      [11:36:11.618] ➤ YN0000: │ 
      [11:36:11.619] ➤ YN0000: │ @@ -16180,13 +16180,12 @@
      [11:36:11.619] ➤ YN0000: │    linkType: hard
      [11:36:11.619] ➤ YN0000: │  
      [11:36:11.619] ➤ YN0000: │  "typescript@patch:typescript@npm%3A^5.0.4#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.8.2#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A~5.8.3#optional!builtin<compat/typescript>":
      [11:36:11.620] ➤ YN0000: │    version: 5.8.3
      [11:36:11.620] ➤ YN0028: │ -  resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=8c6c40"
      [11:36:11.620] ➤ YN0028: │ +  resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
      [11:36:11.620] ➤ YN0000: │    bin:
      [11:36:11.620] ➤ YN0000: │      tsc: bin/tsc
      [11:36:11.620] ➤ YN0000: │      tsserver: bin/tsserver
      [11:36:11.621] ➤ YN0028: │ -  checksum: 10/98470634034ec37fd9ea61cc82dcf9a27950d0117a4646146b767d085a2ec14b137aae9642a83d1c62732d7fdcdac19bb6288b0bb468a72f7a06ae4e1d2c72c9
      [11:36:11.621] ➤ YN0000: │    languageName: node
      [11:36:11.621] ➤ YN0000: │    linkType: hard
      [11:36:11.621] ➤ YN0000: │  
      [11:36:11.621] ➤ YN0000: │  "ua-parser-js@npm:^1.0.35":
      [11:36:11.621] ➤ YN0000: │ 
      [11:36:11.621] ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
      [11:36:11.621] ➤ YN0000: └ Completed
      [11:36:11.621] ➤ YN0000: · Failed with errors in 0s 979ms
      [11:36:12.156] Error: Command "yarn set version 4 && yarn install" exited with 1
      [11:36:12.733] 
      [11:36:15.546] Exiting build container

  1. Attempt to change Vercel deployment yarn version to 4.5.0 by setting Install command to
    yarn set version 4.5.0 && yarn install

  2. Redeploy on Vercel

    • Error: Vercel still uses 4.9.1 anyway for unknown reason
      [11:57:10.656] Running build in Washington, D.C., USA (East) – iad1
      [11:57:10.657] Build machine configuration: 2 cores, 8 GB
      [11:57:10.696] Cloning github.com/gabebohlmann/starter-free (Branch: main, Commit: 03866cb)
      [11:57:11.240] Cloning completed: 542.000ms
      [11:57:16.620] Restored build cache from previous deployment (CZQZHbK5zQUvxeLY79rf2wudPNck)
      [11:57:18.177] Running "vercel build"
      [11:57:18.628] Vercel CLI 42.1.1
      [11:57:18.775] > Detected Turbo. Adjusting default settings...
      [11:57:19.657] Running "install" command: `yarn set version 4 && yarn install`...
      [11:57:20.680] ➤ YN0000: Downloading https://repo.yarnpkg.com/4.9.1/packages/yarnpkg-cli/bin/yarn.js
      [11:57:20.835] ➤ YN0000: Saving the new release in ../../.yarn/releases/yarn-4.9.1.cjs
      [11:57:20.846] ➤ YN0000: Done in 0s 167ms
      [11:57:21.460] ➤ YN0000: · Yarn 4.9.1
      [11:57:21.462] ➤ YN0000: ┌ Project validation
      [11:57:21.463] ➤ YN0057: │ expo-app: Resolutions field will be ignored
      [11:57:21.463] ➤ YN0000: └ Completed
      [11:57:21.483] ➤ YN0000: ┌ Resolution step
      [11:57:22.021] ➤ YN0085: │ + typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5
      [11:57:22.022] ➤ YN0085: │ - typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=8c6c40
      [11:57:22.117] ➤ YN0000: └ Completed in 0s 632ms
      [11:57:22.119] ➤ YN0000: ┌ Post-resolution validation
      [11:57:22.119] ➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
      [11:57:22.211] ➤ YN0000: │ 
      [11:57:22.212] ➤ YN0000: │ @@ -16180,13 +16180,12 @@
      [11:57:22.213] ➤ YN0000: │    linkType: hard
      [11:57:22.213] ➤ YN0000: │  
      [11:57:22.213] ➤ YN0000: │  "typescript@patch:typescript@npm%3A^5.0.4#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.8.2#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A~5.8.3#optional!builtin<compat/typescript>":
      [11:57:22.213] ➤ YN0000: │    version: 5.8.3
      [11:57:22.214] ➤ YN0028: │ -  resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=8c6c40"
      [11:57:22.214] ➤ YN0028: │ +  resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
      [11:57:22.214] ➤ YN0000: │    bin:
      [11:57:22.214] ➤ YN0000: │      tsc: bin/tsc
      [11:57:22.215] ➤ YN0000: │      tsserver: bin/tsserver
      [11:57:22.215] ➤ YN0028: │ -  checksum: 10/98470634034ec37fd9ea61cc82dcf9a27950d0117a4646146b767d085a2ec14b137aae9642a83d1c62732d7fdcdac19bb6288b0bb468a72f7a06ae4e1d2c72c9
      [11:57:22.215] ➤ YN0000: │    languageName: node
      [11:57:22.216] ➤ YN0000: │    linkType: hard
      [11:57:22.216] ➤ YN0000: │  
      [11:57:22.216] ➤ YN0000: │  "ua-parser-js@npm:^1.0.35":
      [11:57:22.216] ➤ YN0000: │ 
      [11:57:22.216] ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
      [11:57:22.217] ➤ YN0000: └ Completed
      [11:57:22.217] ➤ YN0000: · Failed with errors in 0s 753ms
      [11:57:22.250] Error: Command "yarn set version 4 && yarn install" exited with 1
      [11:57:22.828] 
  1. Update local repo to yarn v4.9.1 and push to the remote for Vercel deployment
    • Set local repo to use yarn 4.9.1
      ~/starter-free$ corepack enable
      ~/starter-free$ yarn -v
      Output: 4.5.0
      ~/starter-free$ yarn set version 4.9.1
      ~/starter-free$ yarn -v
      Output: 4.9.1

That updates, .yarnrc.yml, package.json, and .yarn/releases/<version>.cjs for the new yarn version

  1. Run yarn install which will update yarn.lock
    ~/starter-free$ yarn install

    • Sucess
  2. Test local build with yarn build and yarn web
    ~/starter-free$ yarn build

    • Success
  3. Push changes to remote repo and redeploy on Vercel

  4. Error: default Vercel build command is incorrectly set to turbo run build

  5. Update Vercel build command to the correct one from package.json yarn web:prod and redeploy

  6. Success!

@gabebohlmann
Copy link
Author

Tested this again by just directly hooking Vercel up to this repo and it correctly uses yarn v4.5.0 but I still think the upgrade to yarn v4.9.1 should be made because errors occur on deployment.

Error log here

[15:53:16.952] Running build in Washington, D.C., USA (East) – iad1
[15:53:16.953] Build machine configuration: 2 cores, 8 GB
[15:53:16.967] Cloning github.com/gabebohlmann/starter-free-og (Branch: main, Commit: 758913b)
[15:53:16.975] Skipping build cache, deployment was triggered without cache.
[15:53:17.539] Cloning completed: 571.000ms
[15:53:18.062] Running "vercel build"
[15:53:18.903] Vercel CLI 42.2.0
[15:53:20.166] ➤ YN0000: Successfully set enableGlobalCache to false
[15:53:20.187] Installing dependencies...
[15:53:21.189] ➤ YN0000: · Yarn 4.5.0
[15:53:21.190] ➤ YN0000: ┌ Project validation
[15:53:21.191] ➤ YN0057: │ expo-app: Resolutions field will be ignored
[15:53:21.191] ➤ YN0000: └ Completed
[15:53:21.206] ➤ YN0000: ┌ Resolution step
[15:53:22.001] ➤ YN0000: └ Completed in 0s 794ms
[15:53:22.004] ➤ YN0000: ┌ Post-resolution validation
[15:53:22.005] ➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
[15:53:22.082] ➤ YN0000: └ Completed
[15:53:22.083] ➤ YN0000: ┌ Fetch step
[15:54:11.019] ➤ YN0066: │ typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=8c6c40: Cannot apply hunk #1
[15:54:19.904] ➤ YN0000: └ Completed in 57s 821ms
[15:54:19.983] ➤ YN0000: ┌ Link step
[15:54:44.004] ➤ YN0007: │ @biomejs/biome@npm:1.9.4 must be built because it never has been before or the last one failed
[15:54:44.005] ➤ YN0007: │ esbuild@npm:0.25.0 must be built because it never has been before or the last one failed
[15:54:44.005] ➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
[15:54:44.006] ➤ YN0007: │ esbuild@npm:0.14.47 must be built because it never has been before or the last one failed
[15:54:44.006] ➤ YN0007: │ @swc/core@npm:1.11.4 [1ed6c] must be built because it never has been before or the last one failed
[15:54:44.919] ➤ YN0007: │ starter-free@workspace:. must be built because it never has been before or the last one failed
[15:54:47.092] ➤ YN0000: │ starter-free@workspace:. STDOUT Tamagui dependencies look good ✅
[15:54:49.784] ➤ YN0000: │ starter-free@workspace:. STDOUT built @my/config in 410 ms
[15:54:51.027] ➤ YN0000: │ starter-free@workspace:. STDOUT built @my/ui in 481 ms
[15:54:51.034] ➤ YN0000: │ starter-free@workspace:. STDOUT Done in 2s 440ms
[15:54:51.058] ➤ YN0000: └ Completed in 31s 75ms
[15:54:51.245] ➤ YN0000: · Done with warnings in 1m 31s
[15:54:54.600] built @my/config in 183 ms
[15:54:55.424] built @my/ui in 281 ms
[15:54:55.439] Done in 1s 593ms
[15:54:58.182] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[15:54:58.183] This information is used to shape Next.js' roadmap and prioritize features.
[15:54:58.183] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[15:54:58.184] https://nextjs.org/telemetry
[15:54:58.184] 
[15:54:58.237]   ▲ Next.js 14.2.14
[15:54:58.238]   - Environments: .env
[15:54:58.239]   - Experiments (use with caution):
[15:54:58.239]     · scrollRestoration
[15:54:58.239] 
[15:54:58.293]    Creating an optimized production build ...
[15:55:00.186] No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
[15:55:00.548]   [tamagui] skipped loading 4 module, see: https://tamagui.dev/docs/intro/errors#warning-001
[15:55:45.082]  ⚠ Compiled with warnings
[15:55:45.082] 
[15:55:45.082] ../../node_modules/react-native-web/dist/exports/render/index.js
[15:55:45.082] Attempted import error: 'hydrate' is not exported from 'react-dom' (imported as 'domLegacyHydrate').
[15:55:45.082] 
[15:55:45.082] Import trace for requested module:
[15:55:45.082] ../../node_modules/react-native-web/dist/exports/render/index.js
[15:55:45.082] ../../node_modules/react-native-web/dist/index.js
[15:55:45.082] ../../packages/app/provider/NextTamaguiProvider.tsx
[15:55:45.083] 
[15:55:45.083] ../../node_modules/react-native-web/dist/exports/unmountComponentAtNode/index.js
[15:55:45.083] Attempted import error: 'unmountComponentAtNode' is not exported from 'react-dom' (imported as 'unmountComponentAtNode').
[15:55:45.083] 
[15:55:45.083] Import trace for requested module:
[15:55:45.083] ../../node_modules/react-native-web/dist/exports/unmountComponentAtNode/index.js
[15:55:45.083] ../../node_modules/react-native-web/dist/index.js
[15:55:45.083] ../../packages/app/provider/NextTamaguiProvider.tsx
[15:55:45.083] 
[15:55:45.086]    Skipping validation of types
[15:55:45.086]    Linting ...
[15:55:45.493]  ⨯ ESLint: Invalid Options: - Unknown options: useEslintrc, extensions - 'extensions' has been removed.
[15:55:45.496]    Collecting page data ...
[15:55:46.177]    Generating static pages (0/6) ...
[15:55:47.990]    Generating static pages (1/6) 
[15:55:47.991]    Generating static pages (2/6) 
[15:55:48.255]    Generating static pages (4/6) 
[15:55:48.331]  ✓ Generating static pages (6/6)
[15:55:48.685]    Finalizing page optimization ...
[15:55:48.685]    Collecting build traces ...
[15:55:55.054] 
[15:55:55.058] Route (app)                                Size     First Load JS
[15:55:55.058] ┌ ○ /                                      11.9 kB         195 kB
[15:55:55.058] ├ ○ /_not-found                            877 B          88.2 kB
[15:55:55.059] └ ƒ /user/[id]                             809 B           167 kB
[15:55:55.059] + First Load JS shared by all              87.3 kB
[15:55:55.059]   ├ chunks/1dd3208c-5af9e1eb36e1ba27.js    53.6 kB
[15:55:55.059]   ├ chunks/528-f53b50c17ca5ccb6.js         31.7 kB
[15:55:55.059]   └ other shared chunks (total)            1.98 kB
[15:55:55.059] 
[15:55:55.059] Route (pages)                              Size     First Load JS
[15:55:55.059] ┌   /_app                                  0 B             227 kB
[15:55:55.059] ├ ○ /pages-example                         11.9 kB         257 kB
[15:55:55.059] └ ○ /pages-example-user/[id]               1.74 kB         246 kB
[15:55:55.059] + First Load JS shared by all              445 kB
[15:55:55.059]   ├ chunks/framework-f41951523397ef37.js   57.6 kB
[15:55:55.059]   ├ chunks/main-bd8627826fad42c2.js        33.2 kB
[15:55:55.059]   ├ chunks/pages/_app-99477d4b81ae847c.js  134 kB
[15:55:55.059]   ├ css/27470240c4eafd81.css               218 kB
[15:55:55.059]   └ other shared chunks (total)            1.76 kB
[15:55:55.059] 
[15:55:55.059] ○  (Static)   prerendered as static content
[15:55:55.059] ƒ  (Dynamic)  server-rendered on demand
[15:55:55.059] 
[15:55:55.180] Error: No Output Directory named "app" found after the Build completed. You can configure the Output Directory in your Project Settings.
[15:55:55.180] Learn More: https://vercel.link/missing-public-directory
[15:55:55.986] 
[15:55:58.735] Exiting build container

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.

1 participant