-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
fix: better syntax support #939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this pull request! A maintainer will review it soon.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Pull Request Test Coverage Report for Build 7796225717
💛 - Coveralls |
hey @lxsmnsyc , maybe ⨯ unhandledRejection: SyntaxError: /Users/jahir/dev/jahir/website/.contentlayer/generated/Blog/_index.mjs: Support for the experimental syntax 'importAttributes' isn't currently enabled (3:67):
1 | // NOTE This file is auto-generated by Contentlayer
2 |
> 3 | import _23ChangesIn_2023Mdx from './_23-changes-in-2023.mdx.json' assert { type: 'json' }
| ^
4 | import aFreshStartMdx from './a-fresh-start.mdx.json' assert { type: 'json' }
5 | import aPrioriCareMdx from './a-priori-care.mdx.json' assert { type: 'json' }
6 | import astroReadingTimeMdx from './astro-reading-time.mdx.json' assert { type: 'json' }
Add @babel/plugin-syntax-import-attributes (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes) to the 'plugins' section of your Babel config to enable parsing.
at toParseError (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parse-error.ts:74:19)
at JSXParserMixin.raise (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/tokenizer/index.ts:1487:19)
at JSXParserMixin.expectOnePlugin (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/tokenizer/index.ts:1552:18)
at JSXParserMixin.maybeParseImportAttributes (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:3284:14)
at JSXParserMixin.parseImportSourceAndAttributes (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:3109:10)
at JSXParserMixin.parseImportSpecifiersAndAfter (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:3100:17)
at JSXParserMixin.parseImport (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:3066:17)
at JSXParserMixin.parseStatementContent (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:578:25)
at JSXParserMixin.parseStatementLike (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:417:17)
at JSXParserMixin.parseModuleItem (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:354:17)
at JSXParserMixin.parseBlockOrModuleBlockBody (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:1385:16)
at JSXParserMixin.parseBlockBody (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
at JSXParserMixin.parseProgram (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:213:10)
at JSXParserMixin.parseTopLevel (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/statement.ts:195:25)
at JSXParserMixin.parse (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/parser/index.ts:45:10)
at parse (/Users/jahir/dev/jahir/website/node_modules/@babel/parser/src/index.ts:66:38)
at parser (/Users/jahir/dev/jahir/website/node_modules/@babel/core/src/parser/index.ts:28:19)
at parser.next (<anonymous>)
at normalizeFile (/Users/jahir/dev/jahir/website/node_modules/@babel/core/src/transformation/normalize-file.ts:50:24)
at normalizeFile.next (<anonymous>)
at run (/Users/jahir/dev/jahir/website/node_modules/@babel/core/src/transformation/index.ts:39:36)
at run.next (<anonymous>)
at transform (/Users/jahir/dev/jahir/website/node_modules/@babel/core/src/transform.ts:29:20)
at transform.next (<anonymous>)
at step (/Users/jahir/dev/jahir/website/node_modules/gensync/index.js:261:32)
at /Users/jahir/dev/jahir/website/node_modules/gensync/index.js:273:13
at async.call.result.err.err (/Users/jahir/dev/jahir/website/node_modules/gensync/index.js:223:11)
at cb (/Users/jahir/dev/jahir/website/node_modules/gensync/index.js:189:28)
at /Users/jahir/dev/jahir/website/node_modules/@babel/core/src/gensync-utils/async.ts:90:7
at /Users/jahir/dev/jahir/website/node_modules/gensync/index.js:113:33
at step (/Users/jahir/dev/jahir/website/node_modules/gensync/index.js:287:14)
at /Users/jahir/dev/jahir/website/node_modules/gensync/index.js:273:13
at async.call.result.err.err (/Users/jahir/dev/jahir/website/node_modules/gensync/index.js:223:11) {
code: 'BABEL_PARSE_ERROR',
reasonCode: 'MissingOneOfPlugins',
loc: Position { line: 3, column: 66, index: 119 },
pos: 119,
missingPlugin: [ 'importAttributes', 'importAssertions' ]
} |
@jahirfiquitiva |
@lxsmnsyc thanks for the info, the error mentions both |
seems to me that the cause of the issue was Contentlayer, perhaps it can be moved upstream? |
@lxsmnsyc unfortunately Contentlayer development is currently on pause, so it will be hard for this to get fixed there anytime soon. Besides, everything worked fine with million |
Makes it so that the babel plugin supports experimental syntax.