acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
651 stars 74 forks source link

why #132

Open fariellany opened 2 years ago

fariellany commented 2 years ago

E.g: const object: Record<string,any>={name:'hello'}

error:

acorn.mjs:3454 Uncaught SyntaxError: Unexpected token (30:14) at _class../node_modules/acorn/dist/acorn.mjs.pp$4.raise (acorn.mjs:3454:1) at _class../node_modules/acorn/dist/acorn.mjs.pp$9.unexpected (acorn.mjs:750:1) at _class../node_modules/acorn/dist/acorn.mjs.pp$8.parseVar (acorn.mjs:1295:1) at _class../node_modules/acorn/dist/acorn.mjs.pp$8.parseVarStatement (acorn.mjs:1157:1) at _class../node_modules/acorn/dist/acorn.mjs.pp$8.parseStatement (acorn.mjs:905:1) at _class../node_modules/acorn/dist/acorn.mjs.pp$8.parseTopLevel (acorn.mjs:807:1) at _class.parse (acorn.mjs:580:1) at Function.parse (acorn.mjs:630:1) at codeParser (codeParser.tsx:39:1) at ./.dumi/theme/builtins/Previewer.tsx.webpack_exports.default (Previewer.tsx:147:1) at renderWithHooks (react-dom.development.js:14985:1) at mountIndeterminateComponent (react-dom.development.js:17811:1) at beginWork (react-dom.development.js:19049:1) at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1) at invokeGuardedCallback (react-dom.development.js:4056:1) at beginWork$1 (react-dom.development.js:23964:1) at performUnitOfWork (react-dom.development.js:22776:1) at workLoopSync (react-dom.development.js:22707:1) at renderRootSync (react-dom.development.js:22670:1) at performSyncWorkOnRoot (react-dom.development.js:22293:1) at scheduleUpdateOnFiber (react-dom.development.js:21881:1) at updateContainer (react-dom.development.js:25482:1) at react-dom.development.js:26021:1 at unbatchedUpdates (react-dom.development.js:22431:1) at legacyRenderSubtreeIntoContainer (react-dom.development.js:26020:1) at render (react-dom.development.js:26103:1) at renderClient (index.esm.js:684:1) at initialValue (umi.ts:30:1) at index.esm.js:804:1 at Module../src/.umi/umi.ts (umi.ts:36:1) at webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at Object.0 (index.tsx:92:1) at __webpack_require__ (bootstrap:789:1) at bootstrap:856:1 at bootstrap:856:1