sanity-plugin-mapbox-input icon indicating copy to clipboard operation
sanity-plugin-mapbox-input copied to clipboard

Module parse failed: Unexpected token

Open MichaelPrecel opened this issue 3 years ago • 2 comments

Hi @Grsmto – thanks for this plugin!

Unfortunately after following the install instructions I'm receiving the below error. I have added an access token to './config/mapbox-input.json', with no success.

Do you have any advice to get this up and running?

Error in ./node_modules/@math.gl/web-mercator/dist/esm/fly-to-viewport.js
Module parse failed: Unexpected token (50:17)
You may need an appropriate loader to handle this file type.
| }
| export function getFlyToDuration(startProps, endProps, options) {
|   const opts = { ...DEFAULT_OPTS,
|     ...options
|   };
 @ ./node_modules/@math.gl/web-mercator/dist/esm/index.js 6:0-79
 @ ./node_modules/react-map-gl/node_modules/viewport-mercator-project/module.js
 @ ./node_modules/react-map-gl/dist/esm/index.js
 @ ./node_modules/sanity-plugin-mapbox-input/lib/GeopointInput.js (part:@sanity/form-builder/input/geopoint)
 @ ./node_modules/@sanity/form-builder/lib/legacyParts.js
 @ ./node_modules/@sanity/form-builder/lib/sanity/SanityFormBuilderContext.js
 @ ./node_modules/@sanity/form-builder/lib/sanity/legacyPartImplementations/form-builder.js (part:@sanity/form-builder)
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/documentViews/FormView.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/documentViews/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/DocumentPanel.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/DocumentPane.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/DeskToolPane.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/index.js
 @ ./node_modules/@sanity/desk-tool/lib/DeskTool.js
 @ ./node_modules/@sanity/desk-tool/lib/_parts/base-tool.js
 @ ./node_modules/@sanity/vision/lib/VisionTool.js (all:part:@sanity/base/tool)
 @ ./node_modules/@sanity/default-layout/lib/util/getRegisteredTools.js
 @ ./node_modules/@sanity/default-layout/lib/router.js
 @ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
 @ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
 @ ./node_modules/@sanity/server/lib/browser/entry-dev.js
 @ multi ./node_modules/@sanity/server/lib/browser/entry-dev.js

Error in ./node_modules/mjolnir.js/dist/esm/event-manager.js
Module parse failed: Unexpected token (50:25)
You may need an appropriate loader to handle this file type.
|             this.manager.emit(event.type, event);
|         };
|         this.options = { ...DEFAULT_OPTIONS, ...options };
|         this.events = new Map();
|         this.setElement(element);
 @ ./node_modules/mjolnir.js/dist/esm/index.js 1:0-58
 @ ./node_modules/react-map-gl/dist/esm/components/interactive-map.js
 @ ./node_modules/react-map-gl/dist/esm/index.js
 @ ./node_modules/sanity-plugin-mapbox-input/lib/GeopointInput.js (part:@sanity/form-builder/input/geopoint)
 @ ./node_modules/@sanity/form-builder/lib/legacyParts.js
 @ ./node_modules/@sanity/form-builder/lib/sanity/SanityFormBuilderContext.js
 @ ./node_modules/@sanity/form-builder/lib/sanity/legacyPartImplementations/form-builder.js (part:@sanity/form-builder)
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/documentViews/FormView.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/documentViews/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/DocumentPanel.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/documentPanel/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/DocumentPane.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/document/index.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/DeskToolPane.js
 @ ./node_modules/@sanity/desk-tool/lib/panes/index.js
 @ ./node_modules/@sanity/desk-tool/lib/DeskTool.js
 @ ./node_modules/@sanity/desk-tool/lib/_parts/base-tool.js
 @ ./node_modules/@sanity/vision/lib/VisionTool.js (all:part:@sanity/base/tool)
 @ ./node_modules/@sanity/default-layout/lib/util/getRegisteredTools.js
 @ ./node_modules/@sanity/default-layout/lib/router.js
 @ ./node_modules/@sanity/default-layout/lib/Root.js (part:@sanity/base/root)
 @ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
 @ ./node_modules/@sanity/server/lib/browser/entry-dev.js
 @ multi ./node_modules/@sanity/server/lib/browser/entry-dev.js

MichaelPrecel avatar Aug 23 '22 07:08 MichaelPrecel

Same here. Does not work out of the box. Some input very welcome

ApinisMikelis avatar Oct 31 '22 08:10 ApinisMikelis

Hi @ApinisMikelis — from memory I couldn't resolve this and instead switched over to the sanity-plugin-leaflet-input plugin instead.

MichaelPrecel avatar Nov 01 '22 23:11 MichaelPrecel