Grsmto / Grsmto/sanity-plugin-mapbox-input

Module parse failed: Unexpected token

Open
#24 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Sanity development build after following the installation instructions and configuring config/mapbox-input.json. Start with the dependency paths in the error, especially @math.gl/web-mercator, mjolnir.js, react-map-gl, and sanity-plugin-mapbox-input/lib/GeopointInput.js. Done means the development build completes without the module parse errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.