GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
306 stars 58 forks source link

Module parse failed: Unexpected token in Nuxt JS SSR #95

Open eljahon opened 2 years ago

eljahon commented 2 years ago

in ./node_modules/georaster-layer-for-leaflet/dist/georaster-layer-for-leaflet.min.js 2:37677 Module parse failed: Unexpected token (2:37677) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | /! For license information please see georaster-layer-for-leaflet.min.js.LICENSE.txt /

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],e):"object"==typeof exports?exports.GeoRasterLayer=e(require("leaflet")):t.GeoRasterLayer=e(t.L)}(self,(t=>(()=>{var e={1950:function(t,e,a){var n;t=a.nmd(t),function(){var \\ .................................................................... !!!!!!!!!!!!!

DanielJDufour commented 2 years ago

hi, thanks for submitting this issue. I'm not sure of the cause, but this issue usually happens when we encounter newish syntax that isn't fully supported by whatever browser or Node version we are using.

Some examples of the syntax that could throw the error are:

Here's an example of adding babel plugins: https://github.com/GeoTIFF/geoblaze/blob/master/webpack.config.js#L55

Let me know if this helps or if you have any other questions. What framework are you using? Is this create-react-app? I know create-react-app doesn't always have the latest babel plugins.

This can probably be solved by adding some babel plugins to your webpack configuration.