question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use with TypeScript

See original GitHub issue

Hi,

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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bushevcommented, May 19, 2020

I did a simple fix based on the details you provided. It works well for me - https://github.com/bushev/json-bigint/commit/e3e93f71d633cd558bc7c57afcd9e1f54f669d0b

1reaction
ifgeny87commented, Aug 11, 2022

I did a simple fix based on the details you provided. It works well for me - bushev@e3e93f7

The fix fixed the issue. When will you update the npm version?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found