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

Most upvoted comments

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.