Relative import paths need explicit file extensions in ECMAS cript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
1 minute read | a month ago
When I was working on a monorepo using turbo repo I frequenly encountered this error
path/to/file/index.tsx:5:42 - error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
whenever I wanted to build the project. Sometimes after spending so much times tweaking some things, it works magically.
But then later (probably months later) I came to realize that the issue was that, one of my packages(ui)
was including some of the components from the app(web)