nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.82k stars 2.38k forks source link

CI Broken after Migration to 20.0.1 #28493

Closed phihochzwei closed 3 weeks ago

phihochzwei commented 1 month ago

Current Behavior

After Migrating to NX 20.0.1 our complete CI on Gitlab is broken:

Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it. 

An error occurred while processing files for the @nx/storybook/plugin plugin.
 - libs/storybook-host/.storybook/main.ts: invalid type: unit value, expected struct Options
 Error: invalid type: unit value, expected struct Options
 at module.exports.__wbindgen_error_new (/home/metti/code/newhorizon/storefront-v2/node_modules/@swc/wasm/wasm.js:557:17)          at null.<anonymous> (wasm://wasm/0527b1ce:1:15418300)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16314492)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16470335)          at null.<anonymous> (wasm://wasm/0527b1ce:1:5304822)          at null.<anonymous> (wasm://wasm/0527b1ce:1:3105157)          at null.<anonymous> (wasm://wasm/0527b1ce:1:12649011)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1466962)          at null.<anonymous> (wasm://wasm/0527b1ce:1:2825419)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1929194)    - libs/ui-common/.storybook/main.ts: invalid type: unit value, expected struct Options      Error: invalid type: unit value, expected struct Options          at module.exports.__wbindgen_error_new (/home/metti/code/newhorizon/storefront-v2/node_modules/@swc/wasm/wasm.js:557:17)          at null.<anonymous> (wasm://wasm/0527b1ce:1:15418300)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16314492)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16470335)          at null.<anonymous> (wasm://wasm/0527b1ce:1:5304822)          at null.<anonymous> (wasm://wasm/0527b1ce:1:3105157)          at null.<anonymous> (wasm://wasm/0527b1ce:1:12649011)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1466962)          at null.<anonymous> (wasm://wasm/0527b1ce:1:2825419)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1929194)    - libs/ui-dse/.storybook/main.ts: invalid type: unit value, expected struct Options      Error: invalid type: unit value, expected struct Options          at module.exports.__wbindgen_error_new (/home/metti/code/newhorizon/storefront-v2/node_modules/@swc/wasm/wasm.js:557:17)          at null.<anonymous> (wasm://wasm/0527b1ce:1:15418300)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16314492)          at null.<anonymous> (wasm://wasm/0527b1ce:1:16470335)          at null.<anonymous> (wasm://wasm/0527b1ce:1:5304822)          at null.<anonymous> (wasm://wasm/0527b1ce:1:3105157)          at null.<anonymous> (wasm://wasm/0527b1ce:1:12649011)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1466962)          at null.<anonymous> (wasm://wasm/0527b1ce:1:2825419)          at null.<anonymous> (wasm://wasm/0527b1ce:1:1929194)

Expected Behavior

I expect the CI to run as before

GitHub Repo

No response

Steps to Reproduce

  1. Migrate from 19.8.4 to 20.0.1
  2. Test everything locally with success
  3. Comit/Push to Gitlab

Nx Report

Node : 22.2.0 OS : darwin-arm64 Native Target : aarch64-macos npm : 10.7.0

nx : 19.8.4 @nx/js : 19.8.4 @nx/jest : 19.8.4 @nx/linter : 19.8.4 @nx/eslint : 19.8.4 @nx/workspace : 19.8.4 @nx/angular : 20.0.1 @nx/cypress : 19.8.4 @nx/devkit : 19.8.4 @nx/eslint-plugin : 19.8.4 @nx/nest : 19.8.4 @nx/node : 19.8.4 @nx/plugin : 19.8.4 @nx/storybook : 19.8.4 @nrwl/tao : 19.8.4 @nx/web : 20.0.1 @nx/webpack : 20.0.1 typescript : 5.5.3

Registered Plugins: @nx/storybook/plugin

Community plugins: @ngrx/component : 18.0.2 @ngrx/effects : 18.0.2 @ngrx/entity : 18.0.2 @ngrx/router-store : 18.0.2 @ngrx/schematics : 18.0.2 @ngrx/store : 18.0.2 @ngrx/store-devtools : 18.0.2 @storybook/angular : 8.3.5 ng-mocks : 14.13.1 ng2-charts : 6.0.1

Local workspace plugins: @deich-lib/workspace-plugin

The following packages should match the installed version of nx

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

JamesHenry commented 1 month ago

@phihochzwei Your report shows a mixture of different versions of Nx packages, that shouldn't ever be the case.

I would suggest always running nx migrate so that this doesn't happen, but for now you should be able to align everything manually in your package.json.

That should hopefully fix any issues you are seeing, please feel to reopen if you are still facing the same issue after fixing your dependencies.

phihochzwei commented 1 month ago

@JamesHenry This Mixture that is shown in the NX Report is a result of rolling everything back. After the successful migration it was broken

And this is from MY machine, not from our Gitlab

phihochzwei commented 1 month ago

Unfortunately, I dont have the permission to reopen

JamesHenry commented 1 month ago

Ok, it's still something you will want to fix up on your machine, the mixture of versions is undesirable. I have reopened and will leave this for one of my colleagues who is more familiar with the storybook plugin to take a look at

Coly010 commented 1 month ago

Can you provide a repo with a minimal reproduction? It looks like it could be an issue parsing a storybook config file but it’s difficult to know for sure without a reproduction

phihochzwei commented 1 month ago

Unfortunately, our project is quite big which makes it difficult to easily create a minimal version. And also the fact that this only appears on Gitlab Runners, not my or any other local machine makes it even more complicated. But given the info that it is somehow related to Storybook, I will try to create a branch and strip one part from it after the other so see if I can find the causing app/lib

Coly010 commented 1 month ago

Without a reproduction this is going to be difficult to impossible to solve on our end unfortunately

phihochzwei commented 3 weeks ago

Guys, I have no idea what to say. Something happened between 20.0.1 and 20.0.7 which solved the issue.

I just created a branch to strip down to the problem and started with Branch where I just migrated to 20.0.7. And: I works just fine Oo