empress / ember-showdown-prism

https://ember-showdown-prism.netlify.app/
MIT License
11 stars 3 forks source link

Unexpected token '?' #11

Closed jrock2004 closed 4 years ago

jrock2004 commented 4 years ago

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 commented 4 years ago

Hey @jrock2004 👋 the issue is because of an issue that I'm trying to resolve in https://github.com/ember-fastboot/ember-cli-fastboot/pull/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 commented 4 years ago

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

knownasilya commented 4 years ago

Just ran into this as well.