-
Notifications
You must be signed in to change notification settings - Fork 365
Open
Description
I'm working on updating a Node.js TypeScript project to use TypeScript's "module": "nodenext"
and "moduleResolution": "nodenext"
and am getting several compiler errors similar to the following:
error TS2614: Module '"chartjs-plugin-annotation"' has no exported member 'AnnotationOptions'.
Did you mean to use 'import AnnotationOptions from "chartjs-plugin-annotation"' instead?
import type { AnnotationOptions } from 'chartjs-plugin-annotation';
~~~~~~~~~~~~~~~~~
From what I can tell, the problem is caused by the relative imports within chartjs-plugin-annotation's types
directory. Running tsc reveals that TypeScript expects to see, e.g., a ./options
file and doesn't check for ./options.d.ts
:
======== Resolving module './options' from '/Users/josh/src/app/node_modules/chartjs-plugin-annotation/types/index.d.ts'. ========
Explicitly specified module resolution kind: 'NodeNext'.
Resolving in ESM mode with conditions 'import', 'types', 'node'.
Loading module as file / folder, candidate module location '/Users/josh/src/app/node_modules/chartjs-plugin-annotation/types/options', target file types: TypeScript, JavaScript, Declaration, JSON.
Directory '/Users/josh/src/app/node_modules/chartjs-plugin-annotation/types/options' does not exist, skipping all lookups in it.
======== Module name './options' was not resolved. ========
The Are the Types Wrong tool reports these as "internal resolution errors" and also points out issues with CJS versus ESM types.
Metadata
Metadata
Assignees
Labels
No labels