Minimum Node version?

I'm updating our site to the latest version of Twill 2—2.13.0. I have all the composer packages and their dependencies updated and installed and I ran php artisan twill:update successfully. But I'm running into a bug when I run php artisan twill:build:
ERROR Error loading /home/vagrant/website/vendor/area17/twill/vue.config.js:
ERROR SyntaxError: Unexpected token ?
/home/vagrant/website/vendor/area17/twill/vue.config.js:169
ERROR Error loading /home/vagrant/website/vendor/area17/twill/vue.config.js:
ERROR SyntaxError: Unexpected token ?
/home/vagrant/website/vendor/area17/twill/vue.config.js:169
The culprit is this line here that uses the nullish coalescing operator (??):
const host = process.env.APP_URL.split('//')[1] ?? process.env.APP_URL;
const host = process.env.APP_URL.split('//')[1] ?? process.env.APP_URL;
I'm running node v8.17.0 and npm v6.13.4, as the Twill documentation states that npm 6.13 is the recommended version: https://node.green/#ES2020-features--nullish-coalescing-operator-----. But according to node.green the nullish coalescing operator was introduced in node v14: https://node.green/#ES2020-features--nullish-coalescing-operator----- So a few questions: * Is the minimum version of npm for Twill2 different from what's stated in the docs? * Is there a minimum version of node that Twill2 requires? * Barring all that, could I submit a PR to refactor vue.config.js to not use the ?? operator? Thanks!
2 Replies
ifox
ifox14mo ago
Thanks for flagging this @nikhiltri_! it appears this change didn't consider the recommended version in the docs. However, at this point, we can recommend a more recent version. The CI workflow that used to build the default Twill compiled assets was actually using Node 14: https://github.com/area17/twill/blob/2.12.4/.github/workflows/build.yml#L20 With that said, Twill 2 users might benefit from compatibility with older Node/npm versions if their frontend dependencies require it, so I am open to you submitting a PR to not use the ?? operator, and I will happily tag a new version on Twill 2.x.
GitHub
twill/.github/workflows/build.yml at 2.12.4 · area17/twill
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
nikhiltri_
nikhiltri_14mo ago
Great, thanks for the speedy reply! PR submitted, and we'll work on upgrading Node so we can be ready to upgrade to Twill 3!
Want results from more Discord servers?
Add your server