-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on🙋 no/questionThis does not need any changesThis does not need any changes
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
@mdx-js/mdx
Steps to reproduce
https://stackblitz.com/edit/stackblitz-starters-zxbtv1hf?file=index.mjs
# Hello
import foo from './foo.json' with { type 'json' };
Actual behavior
> node index.mjs
[3:30: Could not parse import/exports with acorn] {
ancestors: undefined,
cause: SyntaxError: Unexpected token (1:29)
at pp$4.raise (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:3765:13)
at pp$9.unexpected (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:804:8)
at pp$9.semicolon (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:781:66)
at pp$8.parseImport (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:1971:8)
at pp$8.parseStatement (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:1023:49)
at pp$8.parseTopLevel (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:861:21)
at Parser.parse (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:630:15)
at _0x3aed12.parse (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/acorn/dist/acorn.mjs:683:35)
at Module.eventsToAcorn (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/micromark-util-events-to-acorn/lib/index.js:75:128)
at atEnd (file:///home/projects/stackblitz-starters-zxbtv1hf/node_modules/micromark-extension-mdxjs-esm/lib/syntax.js:208:54) {
pos: 38,
loc: { line: 3, column: 29 },
raisedAt: 33
},
column: 30,
fatal: undefined,
line: 3,
place: { line: 3, column: 30, offset: 38 },
reason: 'Could not parse import/exports with acorn',
ruleId: 'acorn',
source: 'micromark-extension-mdxjs-esm',
url: 'https://github.com/micromark/micromark-extension-mdxjs-esm#could-not-parse-importexports-with-acorn'
}
Expected behavior
Parses import attributes and leaves them in for the generated output.
Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response
Metadata
Metadata
Assignees
Labels
👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on🙋 no/questionThis does not need any changesThis does not need any changes