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: respect NODE_PATH env variable #3411

Merged
merged 10 commits into from
Sep 27, 2022
Merged

Conversation

snitin315
Copy link
Member

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
No.

If relevant, did you update the documentation?
No.

Summary

Fix #3355

Does this PR introduce a breaking change?
No.

Other information
No

@snitin315 snitin315 requested a review from a team as a code owner September 17, 2022 10:51
@codecov
Copy link

codecov bot commented Sep 17, 2022

Codecov Report

Merging #3411 (080c6cc) into next (ee91c94) will decrease coverage by 3.16%.
The diff coverage is 91.45%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #3411      +/-   ##
==========================================
- Coverage   94.91%   91.74%   -3.17%     
==========================================
  Files          30       22       -8     
  Lines        1690     1587     -103     
  Branches      492      447      -45     
==========================================
- Hits         1604     1456     -148     
- Misses         86      131      +45     
Impacted Files Coverage Δ
packages/generators/src/handlers/react.ts 56.81% <56.81%> (ø)
packages/webpack-cli/bin/cli.js 85.71% <66.66%> (+19.04%) ⬆️
packages/serve/src/index.ts 78.94% <78.76%> (-5.33%) ⬇️
...ges/webpack-cli/src/utils/dynamic-import-loader.ts 83.33% <83.33%> (ø)
packages/generators/src/index.ts 86.36% <83.78%> (-13.64%) ⬇️
packages/generators/src/loader-generator.ts 91.66% <85.71%> (ø)
packages/generators/src/init-generator.ts 85.29% <86.20%> (-12.67%) ⬇️
packages/generators/src/addon-generator.ts 92.98% <91.30%> (+0.38%) ⬆️
packages/webpack-cli/src/webpack-cli.ts 93.38% <93.38%> (ø)
packages/generators/src/utils/helpers.ts 95.00% <93.75%> (+10.00%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1524ec2...080c6cc. Read the comment docs.

@snitin315 snitin315 closed this Sep 18, 2022
@snitin315 snitin315 reopened this Sep 18, 2022
@webpack-bot
Copy link

@snitin315 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@alexander-akait Please review the new changes.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Feel free to merge when CI will be green

@snitin315
Copy link
Member Author

Rebased.

@snitin315
Copy link
Member Author

Something wrong on CI, debugging.

@alexander-akait
Copy link
Member

alexander-akait commented Sep 22, 2022

Weird

TypeError: Cannot read properties of undefined (reading 'cli')
at WebpackCLI.getBuiltInOptions (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:25743:60)
at outputHelp (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27213:43)
at Command. (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27467:9)
at async Promise.all (index 63)
at WebpackCLI.run (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27595:5)

@snitin315
Copy link
Member Author

snitin315 commented Sep 24, 2022

On windows CI NODE_PATH is somehow defined.

Screenshot 2022-09-24 at 8 20 30 AM

@snitin315 snitin315 force-pushed the fix/respect-node-path branch from 1f5d53a to 415373e Compare September 24, 2022 11:50
@snitin315
Copy link
Member Author

@alexander-akait fixed, I moved the check outside of the loop.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Looks good too, but can we add test case?

@alexander-akait
Copy link
Member

And let's add the check if (process.env.NODE_PATH) {}

@alexander-akait
Copy link
Member

@snitin315 Can you send the same PR for webpack itself too?

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

Successfully merging this pull request may close these issues.

3 participants