Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError Maximum call stack size exceeded in cloneCallSite #252

Open
tomi opened this issue Sep 16, 2019 · 9 comments
Open

RangeError Maximum call stack size exceeded in cloneCallSite #252

tomi opened this issue Sep 16, 2019 · 9 comments

Comments

@tomi
Copy link

tomi commented Sep 16, 2019

We are experiencing a RangeError similar to issue #93 in our Node.js app. I haven't been able to reproduce it and it seems to be occurring randomly at times.

/usr/src/app/node_modules/source-map-support/source-map-support.js:331
   Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
                                                            ^

RangeError: Maximum call stack size exceeded

We are using the latest version 0.5.13 and latest 10 version of Node.js

@kachkaev
Copy link

kachkaev commented Oct 22, 2019

Getting something similar in a Next.js app. @tomi have you found a workaround by a chance?

RangeError: Maximum call stack size exceeded
    at RegExp.exec (<anonymous>)
    at retrieveSourceMapURL (/path/to/project/node_modules/source-map-support/source-map-support.js:144:21)
    at Array.<anonymous> (/path/to/project/node_modules/source-map-support/source-map-support.js:156:26)
    at /path/to/project/node_modules/source-map-support/source-map-support.js:55:24
    at mapSourcePosition (/path/to/project/node_modules/source-map-support/source-map-support.js:186:21)
    at wrapCallSite (/path/to/project/node_modules/source-map-support/source-map-support.js:358:20)
    at /path/to/project/node_modules/source-map-support/source-map-support.js:399:26
    at Array.map (<anonymous>)
    at Function.prepareStackTrace (/path/to/project/node_modules/source-map-support/source-map-support.js:398:30)
    at prepareStackTrace (internal/errors.js:37:29)
    at formatError (internal/util/inspect.js:907:19)
    at formatRaw (internal/util/inspect.js:703:14)
    at formatValue (internal/util/inspect.js:591:10)
    at inspect (internal/util/inspect.js:221:10)
    at formatWithOptions (internal/util/inspect.js:1693:40)
    at Object.Console.<computed> (internal/console/constructor.js:277:10)
yarn why source-map-support

=> Found "source-map-support@0.5.13"
info Reasons this module exists
   - "ts-node" depends on it
   - Hoisted from "ts-node#source-map-support"
   - Hoisted from "next#terser#source-map-support"
   - Hoisted from "jest#jest-cli#@jest#core#jest-runner#source-map-support"
   - Hoisted from "next#webpack#terser-webpack-plugin#terser#source-map-support"

@tomi
Copy link
Author

tomi commented Oct 22, 2019

@kachkaev I'm not 100% sure as I haven't been able to confirm this yet, but I have a working theory that the culprit might not be source-map-support after all. We were using an old version of applicationinsights library which had an issue that caused these type of errors. The older version of applicationinsights uses zone.js which injects itself pretty much everywhere and can cause hard to debug issues like this.

@leandro-at-sensibill
Copy link

I've been having the exact same problem when debugging a TypeScript mocha test. I am using RubyMine, and this is the command line that starts the debug session:

/Users/leandrocolodete/.nvm/versions/node/v12.18.3/bin/node --inspect-brk=57678 /Users/leandrocolodete/my-project/node_modules/mocha/bin/_mocha --require ts-node/register --timeout 0 --ui bdd --reporter "/Users/leandrocolodete/Library/Application Support/RubyMine2018.3/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js" /Users/leandrocolodete/my-project/src/tests/controllers/ExaaSController_test.ts --grep "^my test$"
Debugger listening on ws://127.0.0.1:57678/4c98c066-b365-4648-ab7c-e39fbab84aec
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

A few seconds later, mocha exits and I can see the following stack trace:

RangeError: Maximum call stack size exceeded
    at RegExp.exec (<anonymous>)
    at retrieveSourceMapURL (/Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:154:21)
    at Array.<anonymous> (/Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:166:26)
    at /Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:65:24
    at mapSourcePosition (/Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:196:21)
    at wrapCallSite (/Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:377:20)
    at Function.prepareStackTrace (/Users/leandrocolodete/my-project/node_modules/source-map-support/source-map-support.js:426:39)
    at maybeOverridePrepareStackTrace (internal/errors.js:87:29)
    at prepareStackTrace (internal/errors.js:66:5)
    at Object.exports.handler (/Users/leandrocolodete/my-project/node_modules/mocha/lib/cli/run.js:321:31)

The source-map-support version I have in my project is 0.5.19.

@tgrassl
Copy link

tgrassl commented Jun 22, 2021

@kachkaev Same issue here. How did you fix it for your app?

@kachkaev
Copy link

kachkaev commented Jun 22, 2021

@tgrassl I haven't seen this error for quite some time despite using ts-node in a few projects. I also don't remember what exactly I was doing when the error occurred for me. Upgrading to Node 14+ and ts-node 10+ might help (but I’m not sure).

@0nlyP2P
Copy link

0nlyP2P commented Dec 14, 2021

I experienced the same issue. I used webpack v5 with typescript. The fix for me was changing

devtool: 'inline-source-map',

to

devtool: 'source-map',

in my webpack.config.js

ZauberNerd added a commit to xing/hops that referenced this issue Jan 12, 2022
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
ZauberNerd added a commit to xing/hops that referenced this issue Jan 12, 2022
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
hops-release-bot bot pushed a commit to xing/hops that referenced this issue Jan 12, 2022
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
hops-release-bot bot pushed a commit to xing/hops that referenced this issue Jan 12, 2022
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
ZauberNerd added a commit to xing/hops that referenced this issue Jan 12, 2022
For some reason we see intermittent failures with the source-map-support
package (examples: evanw/node-source-map-support#252
and evanw/node-source-map-support#93).
The fix that worked for us seems to be to externalize the source-map.

Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Jul 31, 2023
- Introduce `fresh-npm-install.sh` to automate clean npm environment
  setup.
- Revert workaround 924b326, resolved
  by updating Font Awesome.
- Remove `vue-template-compiler` and `@vue/test-utils` from
  dependencies, they're obsolete in 2.7.
- Update anchor references to start with lower case in line with
  MD051/link-fragments, introduced by updated `markdownlint`.
- Upgrade cypress to > 10, which includes:
  - Change spec extensions from `*.spec.js` to `*.cy.js`.
  - Change configuration file from `cypress.json` to
    `cypress.config.ts`.
  - Remove most configurations from `cypress/plugins/index.js`. These
    configurations were initially generated by Vue CLI but obsoleted in
    newer cypress versions.
- Lock Typescript version to 4.6.x due to lack of support in
  unmaintained Vue CLI TypeScript plugin (see vuejs/vue-cli#7401).
- Use `setWindowOpenHandler` on Electron, replacing deprecated
  `new-event` event.
- Document inability to upgrade `typescript-eslint` dependencies because
  `@vue/eslint-config-typescript` does not support them. See
   vuejs/eslint-config-typescript#60, vuejs/eslint-config-typescript#59,
   vuejs/eslint-config-typescript#57.
- Fix `typescript` version to 4.6.X and `tslib` version to 2.4.x,
  unit tests exit with a maximum call stack size exceeded error:

  ```
    ...
    MOCHA  Testing...
    RUNTIME EXCEPTION  Exception occurred while loading your tests
    [=========================] 100% (completed)
    RangeError: Maximum call stack size exceeded
      at RegExp.exec (<anonymous>)
      at retrieveSourceMapURL (/project/node_modules/source-map-support/source-map-support.js:174:21)
      at Array.<anonymous> (/project/node_modules/source-map-support/source-map-support.js:186:26)
      at /project/node_modules/source-map-support/source-map-support.js:85:24
      at mapSourcePosition (/project/node_modules/source-map-support/source-map-support.js:216:21)
    ...
  ```

  Issue has been reported but not fixed, suggested solutions did not
  work, see evanw/node-source-map-support#252.
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Jul 31, 2023
- Introduce `fresh-npm-install.sh` to automate clean npm environment
  setup.
- Revert workaround 924b326, resolved
  by updating Font Awesome.
- Remove `vue-template-compiler` and `@vue/test-utils` from
  dependencies, they're obsolete in 2.7.
- Update anchor references to start with lower case in line with
  MD051/link-fragments, introduced by updated `markdownlint`.
- Upgrade cypress to > 10, which includes:
  - Change spec extensions from `*.spec.js` to `*.cy.js`.
  - Change configuration file from `cypress.json` to
    `cypress.config.ts`.
  - Remove most configurations from `cypress/plugins/index.js`. These
    configurations were initially generated by Vue CLI but obsoleted in
    newer cypress versions.
- Lock Typescript version to 4.6.x due to lack of support in
  unmaintained Vue CLI TypeScript plugin (see vuejs/vue-cli#7401).
- Use `setWindowOpenHandler` on Electron, replacing deprecated
  `new-event` event.
- Document inability to upgrade `typescript-eslint` dependencies because
  `@vue/eslint-config-typescript` does not support them. See
   vuejs/eslint-config-typescript#60, vuejs/eslint-config-typescript#59,
   vuejs/eslint-config-typescript#57.
- Fix `typescript` version to 4.6.X and `tslib` version to 2.4.x,
  unit tests exit with a maximum call stack size exceeded error:

  ```
    ...
    MOCHA  Testing...
    RUNTIME EXCEPTION  Exception occurred while loading your tests
    [=========================] 100% (completed)
    RangeError: Maximum call stack size exceeded
      at RegExp.exec (<anonymous>)
      at retrieveSourceMapURL (/project/node_modules/source-map-support/source-map-support.js:174:21)
      at Array.<anonymous> (/project/node_modules/source-map-support/source-map-support.js:186:26)
      at /project/node_modules/source-map-support/source-map-support.js:85:24
      at mapSourcePosition (/project/node_modules/source-map-support/source-map-support.js:216:21)
    ...
  ```

  Issue has been reported but not fixed, suggested solutions did not
  work, see evanw/node-source-map-support#252.
- Update `vue-cli-plugin-electron-builder` to latest alpha version. This
  allows upgrading `ts-loader` to latest and using latest
  `electron-builder`. Change `main` property value in `package.json` to
  `index.js` for successful electron builds (see
  nklayman/vue-cli-plugin-electron-builder#188).
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Jul 31, 2023
- Introduce `fresh-npm-install.sh` to automate clean npm environment
  setup.
- Revert workaround 924b326, resolved
  by updating Font Awesome.
- Remove `vue-template-compiler` and `@vue/test-utils` from
  dependencies, they're obsolete in 2.7.
- Update anchor references to start with lower case in line with
  MD051/link-fragments, introduced by updated `markdownlint`.
- Upgrade cypress to > 10, which includes:
  - Change spec extensions from `*.spec.js` to `*.cy.js`.
  - Change configuration file from `cypress.json` to
    `cypress.config.ts`.
  - Remove most configurations from `cypress/plugins/index.js`. These
    configurations were initially generated by Vue CLI but obsoleted in
    newer cypress versions.
- Lock Typescript version to 4.6.x due to lack of support in
  unmaintained Vue CLI TypeScript plugin (see vuejs/vue-cli#7401).
- Use `setWindowOpenHandler` on Electron, replacing deprecated
  `new-event` event.
- Document inability to upgrade `typescript-eslint` dependencies because
  `@vue/eslint-config-typescript` does not support them. See
   vuejs/eslint-config-typescript#60, vuejs/eslint-config-typescript#59,
   vuejs/eslint-config-typescript#57.
- Fix `typescript` version to 4.6.X and `tslib` version to 2.4.x,
  unit tests exit with a maximum call stack size exceeded error:

  ```
    ...
    MOCHA  Testing...
    RUNTIME EXCEPTION  Exception occurred while loading your tests
    [=========================] 100% (completed)
    RangeError: Maximum call stack size exceeded
      at RegExp.exec (<anonymous>)
      at retrieveSourceMapURL (/project/node_modules/source-map-support/source-map-support.js:174:21)
      at Array.<anonymous> (/project/node_modules/source-map-support/source-map-support.js:186:26)
      at /project/node_modules/source-map-support/source-map-support.js:85:24
      at mapSourcePosition (/project/node_modules/source-map-support/source-map-support.js:216:21)
    ...
  ```

  Issue has been reported but not fixed, suggested solutions did not
  work, see evanw/node-source-map-support#252.
- Update `vue-cli-plugin-electron-builder` to latest alpha version. This
  allows upgrading `ts-loader` to latest and using latest
  `electron-builder`. Change `main` property value in `package.json` to
  `index.js` for successful electron builds (see
  nklayman/vue-cli-plugin-electron-builder#188).
@kyteague
Copy link

kyteague commented Sep 27, 2023

Still an issue for us 4 years later. Only starts occurring in node v16. This is the only blocker we have in upgrading node right now.

LarrMarburger added a commit to LarrMarburger/privacy.sexy that referenced this issue Nov 16, 2023
- Introduce `fresh-npm-install.sh` to automate clean npm environment
  setup.
- Revert workaround ff134da, resolved
  by updating Font Awesome.
- Remove `vue-template-compiler` and `@vue/test-utils` from
  dependencies, they're obsolete in 2.7.
- Update anchor references to start with lower case in line with
  MD051/link-fragments, introduced by updated `markdownlint`.
- Upgrade cypress to > 10, which includes:
  - Change spec extensions from `*.spec.js` to `*.cy.js`.
  - Change configuration file from `cypress.json` to
    `cypress.config.ts`.
  - Remove most configurations from `cypress/plugins/index.js`. These
    configurations were initially generated by Vue CLI but obsoleted in
    newer cypress versions.
- Lock Typescript version to 4.6.x due to lack of support in
  unmaintained Vue CLI TypeScript plugin (see vuejs/vue-cli#7401).
- Use `setWindowOpenHandler` on Electron, replacing deprecated
  `new-event` event.
- Document inability to upgrade `typescript-eslint` dependencies because
  `@vue/eslint-config-typescript` does not support them. See
   vuejs/eslint-config-typescript#60, vuejs/eslint-config-typescript#59,
   vuejs/eslint-config-typescript#57.
- Fix `typescript` version to 4.6.X and `tslib` version to 2.4.x,
  unit tests exit with a maximum call stack size exceeded error:

  ```
    ...
    MOCHA  Testing...
    RUNTIME EXCEPTION  Exception occurred while loading your tests
    [=========================] 100% (completed)
    RangeError: Maximum call stack size exceeded
      at RegExp.exec (<anonymous>)
      at retrieveSourceMapURL (/project/node_modules/source-map-support/source-map-support.js:174:21)
      at Array.<anonymous> (/project/node_modules/source-map-support/source-map-support.js:186:26)
      at /project/node_modules/source-map-support/source-map-support.js:85:24
      at mapSourcePosition (/project/node_modules/source-map-support/source-map-support.js:216:21)
    ...
  ```

  Issue has been reported but not fixed, suggested solutions did not
  work, see evanw/node-source-map-support#252.
- Update `vue-cli-plugin-electron-builder` to latest alpha version. This
  allows upgrading `ts-loader` to latest and using latest
  `electron-builder`. Change `main` property value in `package.json` to
  `index.js` for successful electron builds (see
  nklayman/vue-cli-plugin-electron-builder#188).
@danramos-evoiq
Copy link

Still having the same issue, any update on this ?

@isaac-levine
Copy link

Any update???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants