parcel: '' panicked at 'cannot access a scoped thread local variable without calling `set` first'
π bug report
Importing an MDX file causes a Rust panic
π― Current Behavior
@parcel/transformer-js: cannot access a scoped thread local variable without calling `set` first
Error: cannot access a scoped thread local variable without calling `set` first
at Object.transform (packages/transformers/js/src/JSTransformer.js:371:9)
at Transformation.runTransformer (packages/core/core/src/Transformation.js:760:7)
at Transformation.runPipeline (packages/core/core/src/Transformation.js:403:36)
at Transformation.runPipelines (packages/core/core/src/Transformation.js:260:29)
at Transformation.runPipelines (packages/core/core/src/Transformation.js:306:34)
at Transformation.run (packages/core/core/src/Transformation.js:174:19)
at Object.run (packages/core/core/src/requests/AssetRequest.js:135:8)
at RequestTracker.runRequest (packages/core/core/src/RequestTracker.js:831:20)
at AssetGraphBuilder.runAssetRequest (packages/core/core/src/requests/AssetGraphRequest.js:815:18)
at PromiseQueue._runFn (packages/core/utils/src/PromiseQueue.js:85:7)
Context
βlast working run was June 29, so likely a regression in 2.0.0-nightly.746β
π» Code Sample
parcel build index.js
// index.js
import page from "./page.mdx";
console.log(page);
// page.mdx
# Hello, world!
package.json:
{
"dependencies": {
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-select": "^4.3.1"
}
}
π Your Environment
Software | Version(s) |
---|---|
Parcel | fd99fa043c2dffe946543c501beff90094f9f703 |
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (10 by maintainers)
Commits related to this issue
- Always use classic JSX runtime with MDX (#6605) — committed to parcel-bundler/parcel by devongovett 3 years ago
Also, While working on the repro for another issue, i confirmed? that this issue only happens when using the JSX pragma, as its the same repro, without the pragma at the top of the file, and it doesnβt throw.