replicate-javascript icon indicating copy to clipboard operation
replicate-javascript copied to clipboard

Fix or explain use of modules with TypeScript

Open mattt opened this issue 2 years ago • 2 comments

In https://github.com/replicate/replicate-javascript/issues/161#issuecomment-1816333059, a user reported the following error:

TypeError: replicate_1.default is not a constructor

A solution was to add "esModuleInterop": true to the project's tsconfig.json file.

We should either make this step unnecessary, or barring that, document this workaround.

mattt avatar Nov 17 '23 12:11 mattt

Note that if you are going to use esModuleInterop, you probably won't be able to use * as Module imports anymore.

depyronick avatar Jan 13 '24 00:01 depyronick

Is this still relevant? cc @aron

zeke avatar May 28 '24 22:05 zeke