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

Unexpected token '?' #11

Closed
jrock2004 opened this issue Aug 26, 2020 · 3 comments
Closed

Unexpected token '?' #11

jrock2004 opened this issue Aug 26, 2020 · 3 comments

Comments

@jrock2004
Copy link

Just installed your addon, and now when I run the ember app and visit localhost:4200 if it does build, I get the following

/var/folders/ml/v_kkd18n5tx7kqd73pwxszq8kgd__9/T/broccoli-14454EqySJH9Y5yYh/out-497-broccoli_merge_trees/assets/vendor.js:110196
      return this.args.language ?? 'markup';
                                 ^

SyntaxError: Unexpected token '?'
    at new Script (vm.js:88:7)
    at VMSandbox.eval (/Users/john.costanzo/Development/website/node_modules/fastboot/src/vm-sandbox.js:13:22)
    at /Users/john.costanzo/Development/website/node_modules/fastboot/src/ember-app.js:190:15
    at Array.forEach (<anonymous>)
    at EmberApp.loadAppFiles (/Users/john.costanzo/Development/website/node_modules/fastboot/src/ember-app.js:187:21)
    at EmberApp.retrieveSandboxedApp (/Users/john.costanzo/Development/website/node_modules/fastboot/src/ember-app.js:235:10)
    at new EmberApp (/Users/john.costanzo/Development/website/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/Users/john.costanzo/Development/website/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/john.costanzo/Development/website/node_modules/fastboot/src/index.js:52:10)
    at /Users/john.costanzo/Development/website/node_modules/ember-cli-fastboot/index.js:335:29

If I remove this addon, remove node modules and redo npm install and start the app, it runs just fine

@mansona
Copy link
Member

mansona commented Aug 26, 2020

Hey @jrock2004 👋 the issue is because of an issue that I'm trying to resolve in ember-fastboot/ember-cli-fastboot#770

Essentially you need to add node: 'current' to your targets in the config/targets.js file so that it looks like this at the bottom:

module.exports = {
  browsers,
  node: 'current'
};

This is absolutely not something that anyone should need to do manually, which is why I'm trying to get it fixed by default upstream 🙈

@jrock2004
Copy link
Author

That did the trick for me. I guess we can close this for now since it now works

@knownasilya
Copy link

Just ran into this as well.

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

No branches or pull requests

3 participants