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).
/dist/webpack:/node_modules/please-upgrade-node/index.js:5 var requiredVersion = pkg.engines.node.replace('>=', '') ^ TypeError: Cannot read property 'replace' of undefined at pleaseUpgradeNode (/dist/webpack:/node_modules/please-upgrade-node/index.js:5:1) at Object.36141 (/dist/webpack:/node_modules/@slack/bolt/dist/index.js:20:1)
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
- enhancement (feature request)
- documentation related
- example code related
- testing related
Requirements (place an
x in each of the
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Filling out the following details about bugs will help us solve your issue sooner.
Steps to reproduce:
- Take an example bolt app,
- build it with
ncc build src/index.ts -o dist)
- See error above
The app should run as normal
The error at the top
Logs, screenshots, screencast, sample project, funny gif, etc.