I have a code that runs on NodeJS 14 on Google Cloud Functions, I am using typescript with tsc to compile my code.
import qs from 'qs'
console.log(`qs >>> ${qs})
The code above logs (in production)
qs >>> undefined
I think the problem is my tsconfig, could someone help to check if there is some something non usual on my configuration?
If I use require('qs') the code works.
My tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017",
"allowSyntheticDefaultImports": true
},
"compileOnSave": true,
"include": ["src", "tests"]
}
Try it with:
import * as qs from 'qs'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With