-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Closed
Copy link
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
Bug Report
🔎 Search Terms
ts1471, Module X cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
🕗 Version & Regression Information
with ts 4.5 beta and module set to "node12"
💻 Code
// import only a type from an ES package from a CJS package
import type { AgendaScheduler } from '@hokify/scheduler';
// some other code
🙁 Actual behavior
It's clear to me that we cannot import from an ES package, but is this true also for type only imports? Is it technically really required to load the type definitions (which are only needed for compile time) with a dynamic import? If so, how would that be done?
🙂 Expected behavior
A type only import from an ES package should still work with module node12 mode within a CJS package
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug