sanity-super-pane
sanity-super-pane copied to clipboard
Module parse failed: Unexpected token (in index.esm.js)
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)),
]);
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: https://github.com/sanity-io/sanity/issues/2092#issuecomment-1017433178