[OpenLayers-Users] Unable to complete part of the openlayers workshop

Dimitris Kar dkarakostis at gmail.com
Wed Sep 26 00:39:06 PDT 2018


I have started the OpenLayers workshop (https://openlayers.org/workshop/en)
but I am stacked in the vectortiles section (
https://openlayers.org/workshop/en/vectortile/bright.html) and more
specifically in the use of  import {apply} from 'ol-mapbox-style'; in order
to load styles, which I created with Maputnik.

The problem occurs after I install: npm install ol-mapbox-style at beta Then
when I run npp start I get the following error message:

ERROR in
./node_modules/@mapbox/mapbox-gl-style-spec/expression/definitions/interpolate.js
Module parse failed: Unexpected token (9:12)
You may need an appropriate loader to handle this file type.
| import { findStopLessThanOrEqualTo } from '../stops';
|
| import type { Stops } from '../stops';
| import type { Expression } from '../expression';
| import type ParsingContext from '../parsing_context';
 @ ./node_modules/@mapbox/mapbox-gl-style-spec/function/index.js 7:0-64
95:33-44 108:16-27
 @ ./node_modules/ol-mapbox-style/stylefunction.js
 @ ./node_modules/ol-mapbox-style/index.js
 @ ./main.js
 @ multi (webpack)-dev-server/client?http://localhost:3000 ./main.js
ℹ 「wdm」: Failed to compile.

I am using a Mac and my node version is v10.10.0. Any idea what can be the
problem here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20180926/3c344d1e/attachment.html>


More information about the Users mailing list