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

Backport Node 14 syntax to comply to minimum reqs #2321

Merged
merged 2 commits into from
Nov 19, 2023

Conversation

nikhiltri
Copy link
Contributor

This PR fixes a bug while running twill:build in a Node v8 environment.

While updating our site to the latest version of Twill 2—2.13.0, we ran into a bug while running twill:build. 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

The culprit is this line here that uses the nullish coalescing operator (??):

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. But according to node.green the nullish coalescing operator was introduced in node v14

This PR refactors vue.config.js to not use the ?? operator.

@ifox ifox merged commit a068e1b into area17:2.x Nov 19, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants