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
% yarn run -s ts-node-esm test.ts
warning package.json: No license field
/private/tmp/a/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
test.ts:1:10 - error TS2305: Module '"graphql-http"' has no exported member 'createHandler'.
1 import { createHandler } from 'graphql-http';
~~~~~~~~~~~~~
at createTSError (/private/tmp/a/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/private/tmp/a/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/private/tmp/a/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/private/tmp/a/node_modules/ts-node/src/index.ts:1433:41)
at transformSource (/private/tmp/a/node_modules/ts-node/src/esm.ts:400:37)
at /private/tmp/a/node_modules/ts-node/src/esm.ts:278:53
at async addShortCircuitFlag (/private/tmp/a/node_modules/ts-node/src/esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/loader:163:22)
at async ESMLoader.load (node:internal/modules/esm/loader:605:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {
diagnosticCodes: [ 2305 ]
}
Expected Behaviour
I expected it to work importing graphql-http module with ESM TypeScript.
Actual Behaviour
but instead it did fail with Module '"graphql-http"' has no exported member '...' error.
Screenshot

Expected Behaviour
I expected it to work importing
graphql-http
module with ESM TypeScript.Actual Behaviour
but instead it did fail with
Module '"graphql-http"' has no exported member '...'
error.Debug Information
test.ts
package.json
tsconfig.json
Further Information
Looking at the type definition of
graphql-http
innode_modules/graphql-http/lib/index.d.mts
, there is no.js
extension.It may works correctly by changing the following code:
The text was updated successfully, but these errors were encountered: