I am working through a legacy app Ember upgrade from 1.x → 2.0 and I am getting ESPrima errors, “Unexpected Token” when building.
Is there any guides for these type of issues?
To Reproduce:
// File: /tmp/test.js
(function(){
import {Promise} from 'rsvp';
})();
npm install -g esprima
esvalidate /tmp/test.js
/tmp/test.js:1: Unexpected token
But, when testing on https://esprima.org/demo/parse.html it works fine.
Thanks in advance
PS:
I found this post that mentioned that esprima would work if it new it was parsing a module, but how do we tell Ember this?
esprima.parse(‘import foo from “bar”’, { sourceType: ‘module’} );