Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript with moduleResolution node16/nodenext is broken #318

Closed
thovden opened this issue Dec 11, 2022 · 0 comments · Fixed by #319
Closed

Typescript with moduleResolution node16/nodenext is broken #318

thovden opened this issue Dec 11, 2022 · 0 comments · Fixed by #319
Assignees
Labels
Context: TypeScript Problem specific to TypeScript Type: bug Verified malfunction

Comments

@thovden
Copy link
Contributor

thovden commented Dec 11, 2022

Description
Describe the problem and how to reproduce it. If appropriate, include code samples, screenshots, error messages, etc.

Building a Typescript project using packages of "type": "module" and "moduleResolution": "nodenext" is broken because the types in the exports section is not specified.

The issue is discussed here: microsoft/TypeScript#50466

Environment:
Specify the environment where you are witnessing the problem:

Version 3.0.22, ESM, Node 16, Typescript, MacOS

Details
Add any other information, context or details that could help track down the problem.

Since Typescript does not find types with the webmidi project, it reverts to the @types/webmidi, imported by the jzz package (a dependency of webmidi). These are probably old.

frontend/audio-ui/src/events/midi-event.ts:1:39 - error TS2306: File '/Users/torgeir/dev/tunasong/node_modules/@types/webmidi/index.d.ts' is not a module.

1 import type { NoteMessageEvent } from 'webmidi'
                                        ~~~~~~~~~

To reproduce:

  1. git clone https://github.com/thovden/webmidi-client-import-issue.git
  2. npm i
  3. tsc

The fix is easy and I will submit a PR for the fix shortly.

@djipco djipco self-assigned this Dec 12, 2022
@djipco djipco added Context: TypeScript Problem specific to TypeScript Type: bug Verified malfunction labels Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context: TypeScript Problem specific to TypeScript Type: bug Verified malfunction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants