Skip to content

.ts import in CLI Puppeteer TS project results in "Cannot find module" #1619

Answered by B4nan
galaczi asked this question in Q&A
Discussion options

You must be logged in to vote

You need to use the .js extension in your imports if your project is ESM - even when inside TS files, it needs to be .js.

relative import paths need full extensions (e.g we have to write import "./foo.js" instead of import "./foo")

https://www.typescriptlang.org/docs/handbook/esm-node.html

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@galaczi
Comment options

Answer selected by galaczi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1618 on October 23, 2022 16:25.