TypeScript error when importing next/image
with "type": "module"
and "moduleResolution": "nodenext"
#47279
Closed
1 task done
Labels
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 Binaries: Node: 18.12.1 npm: 8.19.2 Yarn: N/A pnpm: 7.29.1 Relevant packages: next: 13.2.5-canary.8 eslint-config-next: 13.2.4 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
TypeScript
Link to the code that reproduces this issue
https://github.com/michaelhays/next-ts-import
To Reproduce
In a new Next.js project, add
"type": "module"
topackage.json
, and set"moduleResolution": "nodenext"
intsconfig.json
.Importing
next/image
(or anynext/*
package) throws a TypeScript error, though the package is actually found when running the app.Describe the Bug
Expected Behavior
The import should be found by TypeScript.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: