-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Bug Report
🔎 Search Terms
ts getJSXImplicitImportBase
ts jest getJSXImplicitImportBase
ts file.pragmas
🕗 Version & Regression Information
4.2.4
- This is the behaviour in every version I tried, and I reviewed the FAQ for entries about everything but it hasn't been covered.
⏯ Playground Link
I can't provide a link to a playground as this issue seems to be tied to the structure of the repository and dependencies.
I have tried to reproduce a minimal example but without luck for now.
💻 Code
This seems to be tied to the structure of the repository and dependencies:
- There are 2 monorepositories -
coreandproduct - One of the packages in
coreistoast - In
productthere areuiandservices - Both
uiandservicesare dependent ontoastwhich is installed as an external dependency from npmjs registry in both of them uiis dependent onservices
toast <-- external dependency (core monorepo)
| |
services | <-- product monorepo
\ |
ui <-- product monorepoIn ui there is a Toast with custom visual implementations for the toast from core with its own tests.
🙁 Actual behavior
Running tests with npx jest packages/ui/src/components/Toast/__tests__/Toast.spec.tsx crashes with:
TypeError: Cannot read property 'get' of undefined
at Object.getJSXImplicitImportBase (../../node_modules/typescript/lib/typescript.js:19175:95)
at transformSourceFile (../../node_modules/typescript/lib/typescript.js:88624:51)
at transformSourceFileOrBundle (../../node_modules/typescript/lib/typescript.js:82540:57)
at transformation (../../node_modules/typescript/lib/typescript.js:100190:24)
at transformRoot (../../node_modules/typescript/lib/typescript.js:100217:82)
at Object.transformNodes (../../node_modules/typescript/lib/typescript.js:100201:78)
at emitJsFileOrBundle (../../node_modules/typescript/lib/typescript.js:100852:32)
at emitSourceFileOrBundle (../../node_modules/typescript/lib/typescript.js:100799:13)
at forEachEmittedFile (../../node_modules/typescript/lib/typescript.js:100520:34)
at Object.emitFiles (../../node_modules/typescript/lib/typescript.js:100779:9)
when inspecting the issue I have noticed this behaviour:
- The file that causes the crash is
packages/ui/node_modules/@private/core-toast/src/index.ts SourceFileObjectof this file is missingpragmasmap- But it contains
redirectInfowithredirectTarget:packages/ui/node_modules/@private/product-services/node_modules/@private/core-toast/src/index.ts - The
SourceFileObjectfrom thisredirectInfocontainspragmasmap
This happens during local development as well as in travis CI.
🙂 Expected behavior
The jest tests run without crashing.
Maybe related issue
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone