Skip to content

Upgrade Yarn to 4.5.1 and Nx to 20 for fixing alias packaging resolution - #2954

Merged
Yicong-Huang merged 25 commits into
masterfrom
yicong-fix-frontend-ci
Oct 22, 2024
Merged

Yicong-Huang merged 25 commits into
masterfrom
yicong-fix-frontend-ci

Conversation

@Yicong-Huang

@Yicong-Huang Yicong-Huang commented Oct 20, 2024 •

Copy link
Copy Markdown
Contributor

This PR fixes CI issues introduced in #2912. The symptom is frontend test ci failed without failing the entire CI. There are a few reasons underneath:

  • Alias dependency resolution issue. The newly introduced Monaco-editor-wrapper has peer dependency with alias @codingame/[email protected]. Yarn@1 will install it as vscode@npm:@codingame/[email protected] in the lock file.
    However, during parsing the lock file, Nx reports cannot find the package with name npm:vscode@npm:@codingame/monaco-vscode-api (note for the npm: in the beginning).

Solution (2 steps):

  1. Added resolution in package.json monaco-editor: npm:vscode@npm:@codingame/monaco-vscode-api so that the generated lock file has correct handle.
  2. To be able to parse this added resolution field, Yarn@1 has to be upgraded to [email protected].
  • multiple webpack resolution issue. Our project uses a custom webpack. Monaco also introduces their webpack dependency. There are multiple webpacks, and the used version got resolved to be @5.92.3 which caused error when bundling frontend compile files.

Solution: pin webpack version to use @5.89.0 in resolution.

  • Nx not failing upon a failed execution. In Upgrade Monaco Language Client to 8.8.3 #2912, we also updated the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be executed, but Nx reports success (did not return error).

Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug was introduced so that errors reported from the project graph build during the daemon process would not be rethrown, causing the main thread to not fail properly. We updated it to version @20.0.3 and it is confirmed to be solved. See https://github.com/Texera/texera/actions/runs/11429004023 (it properly failed the CI).

Steps to migrate this PR:

Under core directory:

Under core/gui directory:

  • You can verify the Yarn version with yarn --version. It should show 4.5.1
  • Remove all cached/dependency files: rm -rf node_modules .angular
  • Reinstall with the upgraded Yarn: yarn install

@Yicong-Huang Yicong-Huang self-assigned this Oct 20, 2024
@Yicong-Huang Yicong-Huang added bug fix testing frontend Changes related to the frontend GUI labels Oct 20, 2024

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread core/gui/nx.json Resolved
Comment thread core/gui/tsconfig.json Resolved
@Yicong-Huang
Yicong-Huang merged commit 3e0d60e into master Oct 22, 2024
@Yicong-Huang
Yicong-Huang deleted the yicong-fix-frontend-ci branch October 22, 2024 01:22
shengquan-ni added a commit that referenced this pull request Nov 1, 2024
The old docker file does not sync with the latest yarn change(#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
PurelyBlank pushed a commit that referenced this pull request Dec 4, 2024
…ion (#2954)

This PR fixes CI issues introduced in #2912. The symptom is frontend
test ci failed without failing the entire CI. There are a few reasons
underneath:

- **Alias dependency resolution issue.** The newly introduced
`Monaco-editor-wrapper` has peer dependency with alias
`@codingame/[email protected]`. Yarn@1 will install it as
`vscode@npm:@codingame/[email protected]` in the lock file.
However, during parsing the lock file, Nx reports cannot find the
package with name `npm:vscode@npm:@codingame/monaco-vscode-api` (note
for the `npm:` in the beginning).

> Solution (2 steps): 
> 1. Added resolution in package.json `monaco-editor:
npm:vscode@npm:@codingame/monaco-vscode-api` so that the generated lock
file has correct handle.
> 2. To be able to parse this added resolution field, Yarn@1 has to be
upgraded to [email protected].

- **multiple webpack resolution issue.** Our project uses a custom
webpack. Monaco also introduces their webpack dependency. There are
multiple webpacks, and the used version got resolved to be `@5.92.3`
which caused error when bundling frontend compile files.

> Solution: pin webpack version to use `@5.89.0` in resolution.

- **Nx not failing upon a failed execution.** In #2912, we also updated
the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be
executed, but Nx reports success (did not return error).

> Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug
was introduced so that errors reported from the project graph build
during the daemon process would not be rethrown, causing the main thread
to not fail properly. We updated it to version @20.0.3 and it is
confirmed to be solved. See
https://github.com/Texera/texera/actions/runs/11429004023 (it properly
failed the CI).


### Steps to migrate this PR:
Under `core` directory:
- You need to switch from Yarn@1 to [email protected]: run `corepack enable &&
corepack prepare [email protected] --activate && yarn --cwd gui set version
4.5.1`

Under `core/gui` directory:
- You can verify the Yarn version with `yarn --version`. It should show
4.5.1
- Remove all cached/dependency files: `rm -rf node_modules .angular`
- Reinstall with the upgraded Yarn: `yarn install`
PurelyBlank pushed a commit that referenced this pull request Dec 4, 2024
The old docker file does not sync with the latest yarn change(#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
@Yicong-Huang Yicong-Huang removed the bug label Oct 4, 2025
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
…ion (apache#2954)

This PR fixes CI issues introduced in apache#2912. The symptom is frontend
test ci failed without failing the entire CI. There are a few reasons
underneath:

- **Alias dependency resolution issue.** The newly introduced
`Monaco-editor-wrapper` has peer dependency with alias
`@codingame/[email protected]`. Yarn@1 will install it as
`vscode@npm:@codingame/[email protected]` in the lock file.
However, during parsing the lock file, Nx reports cannot find the
package with name `npm:vscode@npm:@codingame/monaco-vscode-api` (note
for the `npm:` in the beginning).

> Solution (2 steps): 
> 1. Added resolution in package.json `monaco-editor:
npm:vscode@npm:@codingame/monaco-vscode-api` so that the generated lock
file has correct handle.
> 2. To be able to parse this added resolution field, Yarn@1 has to be
upgraded to [email protected].

- **multiple webpack resolution issue.** Our project uses a custom
webpack. Monaco also introduces their webpack dependency. There are
multiple webpacks, and the used version got resolved to be `@5.92.3`
which caused error when bundling frontend compile files.

> Solution: pin webpack version to use `@5.89.0` in resolution.

- **Nx not failing upon a failed execution.** In apache#2912, we also updated
the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be
executed, but Nx reports success (did not return error).

> Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug
was introduced so that errors reported from the project graph build
during the daemon process would not be rethrown, causing the main thread
to not fail properly. We updated it to version @20.0.3 and it is
confirmed to be solved. See
https://github.com/Texera/texera/actions/runs/11429004023 (it properly
failed the CI).


### Steps to migrate this PR:
Under `core` directory:
- You need to switch from Yarn@1 to [email protected]: run `corepack enable &&
corepack prepare [email protected] --activate && yarn --cwd gui set version
4.5.1`

Under `core/gui` directory:
- You can verify the Yarn version with `yarn --version`. It should show
4.5.1
- Remove all cached/dependency files: `rm -rf node_modules .angular`
- Reinstall with the upgraded Yarn: `yarn install`
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
The old docker file does not sync with the latest yarn change(apache#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
…ion (apache#2954)

This PR fixes CI issues introduced in apache#2912. The symptom is frontend
test ci failed without failing the entire CI. There are a few reasons
underneath:

- **Alias dependency resolution issue.** The newly introduced
`Monaco-editor-wrapper` has peer dependency with alias
`@codingame/[email protected]`. Yarn@1 will install it as
`vscode@npm:@codingame/[email protected]` in the lock file.
However, during parsing the lock file, Nx reports cannot find the
package with name `npm:vscode@npm:@codingame/monaco-vscode-api` (note
for the `npm:` in the beginning).

> Solution (2 steps): 
> 1. Added resolution in package.json `monaco-editor:
npm:vscode@npm:@codingame/monaco-vscode-api` so that the generated lock
file has correct handle.
> 2. To be able to parse this added resolution field, Yarn@1 has to be
upgraded to [email protected].

- **multiple webpack resolution issue.** Our project uses a custom
webpack. Monaco also introduces their webpack dependency. There are
multiple webpacks, and the used version got resolved to be `@5.92.3`
which caused error when bundling frontend compile files.

> Solution: pin webpack version to use `@5.89.0` in resolution.

- **Nx not failing upon a failed execution.** In apache#2912, we also updated
the Nx from @18.1.3 to @18.2.0. The frontend test is failed to be
executed, but Nx reports success (did not return error).

> Solution: this seems to be a bug on Nx side. in release @18.2.0, a bug
was introduced so that errors reported from the project graph build
during the daemon process would not be rethrown, causing the main thread
to not fail properly. We updated it to version @20.0.3 and it is
confirmed to be solved. See
https://github.com/Texera/texera/actions/runs/11429004023 (it properly
failed the CI).


### Steps to migrate this PR:
Under `core` directory:
- You need to switch from Yarn@1 to [email protected]: run `corepack enable &&
corepack prepare [email protected] --activate && yarn --cwd gui set version
4.5.1`

Under `core/gui` directory:
- You can verify the Yarn version with `yarn --version`. It should show
4.5.1
- Remove all cached/dependency files: `rm -rf node_modules .angular`
- Reinstall with the upgraded Yarn: `yarn install`
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
The old docker file does not sync with the latest yarn change(apache#2954) and
fails to compile. This PR updates the Dockerfile to use yarn 4.5.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants