miguelcobain/ember-leaflet

Issue with installing and using ember-leaflet with Fastboot

czerwina opened this issue · 1 comments

Currently after installing the ember-leaflet addon, and starting up ember serve on a fastboot based ember application we see the following error:

`App is being served by FastBoot
/tmp/broccoli-8863iXuGrBPWGDT/out-397-append_ember_auto_import_analyzer/assets/vendor.js:113462
this._layer.dragging?.enable();
^

SyntaxError: Unexpected token .`

I have found reference to fastboot and that the addon should work with fastboot.

This happens because node is not on the config/targets.js file.
This was actually fixed on ember-cli-fastboot v3.0.0-beta.2 (see ember-fastboot/ember-cli-fastboot#770).

To fix this you have to change the following in your config/targets.js file, from:

module.exports = {
  browsers
};

to

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

This will now transpile the code according to your current node version, which will allow it to run the code in node (which is needed for fastboot).

This error is not necessarily related with ember-leaflet. It could have happened anywhere if you used recent js features, even in app code.