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
I am migrating a repository to standard ESM, and I got the following issue with use-ssr.
error TS2349: This expression is not callable.
Type 'typeof import("_THE_PATH_OF_MY_PROJECT_HERE/node_modules/use-ssr/dist/useSSR")' has no call signatures.
21 const { isServer } = useSSR();
A full description of the issue, as well as a solution to fix it, is available here
From what I understood: use-ssr describes the default export from the main field of package.json, which is making Typescript interpret it as a CommonJS default export. Full explanation here
For those who are looking for an immediate solution, please find a workaround here
Environment
Node 18
Typescript 4.8.4 with the following config
The text was updated successfully, but these errors were encountered:
GabrielDelepine
changed the title
ESM import/export is broken with Typescript >= 4.7 and module=node16|nodenext
ESM import/export is broken with Typescript >= 4.7 and moduleResolution=node16
Oct 21, 2022
Minimal reproduction repo
https://github.com/GabrielDelepine/tsc-esm-issue-with-use-ssr
Bug report
I am migrating a repository to standard ESM, and I got the following issue with use-ssr.
A full description of the issue, as well as a solution to fix it, is available here
From what I understood:
use-ssr
describes the default export from themain
field ofpackage.json
, which is making Typescript interpret it as a CommonJS default export. Full explanation hereFor those who are looking for an immediate solution, please find a workaround here
Environment
Node 18
Typescript 4.8.4 with the following config
The text was updated successfully, but these errors were encountered: