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

Fix package resolving failure in CLI #11830

Merged
merged 1 commit into from
Nov 3, 2022
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Nov 3, 2022

What it does

With the introduction of ESM modules, a lot of packages have started to utilize the exports field of the package.json file. This came with a change in the require.resolve function which automatically tried to resolve the default export of package.json, preventing us to actually get the path to the package.json file. For more information see here.

The package resolve-package-path simulates the node.js package resolving algorithm and prevents the Failed to resolve module warning to appear which confuses a lot of developers (see #11822 for example).

How to test

  1. Run the theia build command
  2. Assert that no Failed to resolve module warning is printed to the console.

Review checklist

Reminder for reviewers

@msujew msujew added quality issues related to code and application quality theia-cli issues related to the theia-cli labels Nov 3, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes work well for me 👍

@msujew msujew merged commit 1ef59d1 into master Nov 3, 2022
@msujew msujew deleted the msujew/fix-resolve-failure branch November 3, 2022 19:08
@github-actions github-actions bot added this to the 1.32.0 milestone Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality issues related to code and application quality theia-cli issues related to the theia-cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants