Unable to use with TypeScript
See original GitHub issueHi,
The module is great! But I can’t use it with a TypeScript Lambda function on AWS. It fails in runtime with error:
TypeError: Right-hand side of 'instanceof' is not callable
at str (***:/node_modules/json-bigint/lib/stringify.js:218:1)
at Function.module.exports.JSON.stringify (***:/node_modules/json-bigint/lib/stringify.js:380:1)
at Response.toLambdaResponse (***:/_core/response.ts:91:71)
at LambdaHandler.execute (***:/_core/LambdaHandler.ts:123:47)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
My tsconfig.json is
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "esnext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"declaration": false,
"listFiles": false,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"lib": [
"esnext",
"es2019"
]
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Unable to use typescript with expo - "It looks like you're trying ...
It looks like you're trying to use TypeScript but don't have the required dependencies installed. Please install @types/react by running: yarn ...
Read more >TypeScript errors and how to fix them
Common Errors. Below you find a list of common TypeScript errors along with the buggy code and its fixed version.
Read more >[@types/react-modal] Unable to use with Typescript #60781
I'm trying to use @react-modal in a React-based component library using Typescript - this is generating a host of errors, similar to this:...
Read more >TypeScript Compiling with Visual Studio Code
VS Code integrates with tsc through our integrated task runner. We can use this to transpile .ts files into .js files. Another benefit...
Read more >Cannot find name 'console' Error in TypeScript | bobbyhadz
To solve the "Cannot find name console " error, install the node types if running in Node.js by running npm i -D @types/node...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did a simple fix based on the details you provided. It works well for me - https://github.com/bushev/json-bigint/commit/e3e93f71d633cd558bc7c57afcd9e1f54f669d0b
The fix fixed the issue. When will you update the npm version?