Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module parse failed: Unexpected token (in index.esm.js) #58

Open
ppo opened this issue Jan 4, 2022 · 1 comment
Open

Module parse failed: Unexpected token (in index.esm.js) #58

ppo opened this issue Jan 4, 2022 · 1 comment

Comments

@ppo
Copy link

ppo commented Jan 4, 2022

Version: 1.0.0-alpha.1

Error

Error in ./node_modules/sanity-super-pane/dist/index.esm.js
Module parse failed: Unexpected token (159:30)
You may need an appropriate loader to handle this file type.
|
|       for (const publishedDocument of publishedDocuments) {
|         t.createIfNotExists({ ...publishedDocument,
|           _id: `drafts.${publishedDocument._id}`,
|           _updatedAt: new Date().toISOString()
 @ ./deskStructure.js (part:@sanity/desk-tool/structure 10:23-51)
 @ ./node_modules/@sanity/desk-tool/lib/utils/loadStructure.js
 @ ./node_modules/@sanity/desk-tool/lib/utils/useResolvedPanes.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/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

deskStructue.js

import S from '@sanity/desk-tool/structure-builder';
import { createSuperPane } from 'sanity-super-pane';

export default () =>
  S.list()
    .title('Base')
    .items([
      S.listItem().title('Normal List').child(createSuperPane('movie', S)),
    ]);
@fschultz
Copy link

Ran into this as well, seems to be related to using external packages with more modern EcmaScript syntax.

This post includes a work-around to fix it: sanity-io/sanity#2092 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants