-
Notifications
You must be signed in to change notification settings - Fork 393
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
PleaseUpgradeNode issues with NCC/Webpack #1274
Comments
Hey @barlock thanks for writing in. I can't reproduce with the repro steps you provided:
I also tried removing the Any tips on how best I can reproduce the issue? |
I made a repo to reproduce: https://github.com/barlock/bolt-issue-repro After cloning:
I'm honestly not sure what the difference is between your steps and mine. I thought it might be typescript, but that doesn't appear to be it. I'll be curious if you can reproduce with my repo. |
Thanks, indeed I can repro now. Looks like the project's package json gets copied and injected into the bundle generated by I'm not sure duplicating the engines content into the index is a nice change 😞 . We don't actually use webpack to build and distribute this library, only I'm open to solving this issue but also don't want to bend over backwards just to appease whatever new bundler's non-standard module resolution approach happens to come along. If you have suggestions, we're open to ideas! |
Description
When building a bolt app with ncc (which uses webpack) pleaseUpgradeNode in the index breaks as it can't find your package.json. I have a monorepo and it picked up my root package.json (which didn't have engines in it).
Error:
Possible solutions:
It strikes me that please-upgrade-node is designed for CLI tools, not libraries. Simply embedding the engine config into the index would work great, It does introduce some duplication though. You distribute your own webpack'd version of the library, maybe you can build it in? Lots of good solutions out there.
After combing through the generated files I found a workaround for me that I just need to add an
engines.node
block into my own package, but that wasn't the intentions of the bolt authors I assume.What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
NA
Steps to reproduce:
ncc
intodist
(something likencc build src/index.ts -o dist
)node dist/index.js
Expected result:
The app should run as normal
Actual result:
The error at the top
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
The text was updated successfully, but these errors were encountered: