-
There are three possible cases:import * as uWS from 'uWebSockets.js';
console.log(uWS.App); // uWS.App has correct function signature, but is actually `undefined` import uWS from 'uWebSockets.js/uws.js';
console.log(uWS.App); // uWS.App has type `any`, but is actually a function import uWS from 'uWebSockets.js';
// Module '"${project_path}/node_modules/uWebSockets.js/index"' has no default export.ts(1192)
console.log(uWS.App); // uWS.App has type `any`, but is actually a function How to reproduceNodeJS 14 {
"compilerOptions": {
"moduleResolution": "Node",
"module": "ES2020",
"target": "ES2020",
"allowJs": true,
"checkJs": true,
"strict": false,
"noEmit": true
},
"include": [
"**/*.js",
"**/*.ts"
],
"exclude": [
"node_modules"
]
}
{
"name": "project",
"version": "0.1.0",
"type": "module",
"dependencies": {
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.9.0"
},
"devDependencies": {
"@types/node": "^14.14.5",
"typescript": "^4.0.5"
}
} Put any of the above three code snippets into P.S.I did try different combinations of |
Beta Was this translation helpful? Give feedback.
Answered by
qwelias
Oct 29, 2020
Replies: 1 comment
-
Fixed by enabling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed by enabling
"esModuleInterop": true
🤦