Does not compile with TypeScript 4.7 module = nodenext
See original GitHub issueDescription
Can’t compile TypeScript project using @master-chief/alpaca with module = nodenext
in tsconfig.json.
Expected TypeScript compilation pass.
Reproduction
- Install latest TypeScript (4.7.3)
- Install latest @master-chief/alpaca (6.3.20):
npm i @master-chief/alpaca
- Create tsconfig with module=NodeNext:
"compilerOptions": { "target": "es2020", "module": "NodeNext", "strict": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true },
- Create index.ts importing alpaca stuff:
import { AlpacaClient, AlpacaStream } from '@master-chief/alpaca';
- Try to compile TypeScript:
tsc
Logs
error TS7016: Could not find a declaration file for module '@master-chief/alpaca'. '.../node_modules/@master-chief/alpaca/dist/mjs/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/master-chief__alpaca` if it exists or add a new declaration (.d.ts) file containing `declare module '@master-chief/alpaca';`
Issue Analytics
- State:
- Created a year ago
- Comments:22
Top Results From Across the Web
Documentation - TypeScript 4.7
When a .ts file is compiled as an ES module, ECMAScript import / export ... ES modules, and .cjs files are always CommonJS...
Read more >"moduleResolution": "NodeNext" throws ESM related errors ...
Install typescript@4.7.4 and pretty-ms. Set tsconfig.json as... ... Basically this code won't work w moduleResolution set to nodenext .
Read more >Understanding TypeScript 4.7 and ECMAScript module support
In this post we'll test drive that support by attempting to build a simple module in TypeScript using the new ECMAScript modules support....
Read more >node.js - Why we need "nodenext" typescript compiler option ...
Namely, I have a test package, using TypeScript 4.7.0-beta, with tsconfig.json containing module set to nodenext . A file with .cts is not...
Read more >tsc-esm-fix - npm
meta is not allowed. esbuild/1043: empty output for interface files that breaks reimport. moduleResolution: nodenext. Nightly build TypeScript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i’m going to write a new build script and config which generates the new declarations tomorrow. too tired right now
Will investigate.