You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to upgrade from 3.4.17 to latest and have started running into this error as of 3.5.0:
index.ts:5:8 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@apollo/client")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/project/workspace/package.json'.
5 } from "@apollo/client";
~~~~~~~~~~~~~~~~
I have included a reproduction link. Simply using "module": "NodeNext" in tsconfig.json will cause this. This is the recommended setting for "modern Node.js projects" per the TypeScript documentation. Do you have any recommendations on how to address this? My project is not ESM today.
Thanks for opening this! I'll do my best to take a look at this today. I'm currently working on a reproduction for a potential React bug and I'm on vacation starting tomorrow for the next week. If not me, I'll see if one of the other maintainers has some bandwidth to take a look. Thanks!
Issue Description
Trying to upgrade from
3.4.17
to latest and have started running into this error as of3.5.0
:I have included a reproduction link. Simply using
"module": "NodeNext"
in tsconfig.json will cause this. This is the recommended setting for "modern Node.js projects" per the TypeScript documentation. Do you have any recommendations on how to address this? My project is not ESM today.Link to Reproduction
https://codesandbox.io/p/devbox/recursing-yalow-s8fmpr
Reproduction Steps
Run
tsc
in the terminal of the repro. Main config setting to set is"module": "NodeNext"
in tsconfig.json@apollo/client
version3.10.4
The text was updated successfully, but these errors were encountered: