Closed cspotcode closed 1 year ago
I can't say what are the reproducible steps per se as there's nothing special about the project. If I am able to create a simpler version that causes the same issue I'll post it here. It's a TS NextJS project.
The information that I have at the moment are the following:
Error:
C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:227 while (match = re.exec(fileData)) lastMatch = match; ^ RangeError: Maximum call stack size exceeded at RegExp.exec (<anonymous>) at retrieveSourceMapURL (C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:227:21) at Array.<anonymous> (C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:239:26) at C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:138:32 at mapSourcePosition (C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:269:21) at wrapCallSite (C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:461:20) at prepareStackTrace (C:\Users\user\repo\node_modules\@cspotcode\source-map-support\source-map-support.js:541:41) at Function.prepareStackTrace (C:\Users\user\repo\node_modules\tslog\src\CallSitesHelper.ts:59:31) at maybeOverridePrepareStackTrace (node:internal/errors:141:29) at prepareStackTrace (node:internal/errors:115:5) error Command failed with exit code 1.
OS: Windows 10 Pro version 21H2 it only happens on Windows and Linux subsystem for windows, I wasn't able to replicate on Mac OS or a native Linux machine.
It mostly happens when using node 16. I haven't observed the issue as much when rolling back to 14
@GhaithZamrik
I can't say what are the reproducible steps per se as there's nothing special about the project.
https://en.wikipedia.org/wiki/Minimal_reproducible_example
a collection of source code and other data files which allow a bug or problem to be demonstrated and reproduced
^^ You'll need to share exactly that.
@cspotcode Yes, I understand that...
As I said I will share something when I have an example that I can share and reproduces the issue :)
Thank you, @cspotcode for pointing that out.
@GhaithZamrik, have you been able to extract a minimal example? I would appreciate it a lot.
I've been working on a new, completely rewritten version (4.0), which does not use this logic anymore. Can you give it a go and let me know if that solves your problem?
npm i tslog@next
and run it with node --enable-source-maps
or for TypeScript node --enable-source-maps --experimental-specifier-resolution=node --no-warnings --loader ts-node/esm
Thank you.
V4 is released now, so I'm going to close this issue. Feel free to open a new one if V4 didn't solve it for you.
Here are the docs: tslog.js.org
I met this issue again with node version: v16.18.0 @cspotcode/source-map-support: 0.8.1 I didn't find tslog in my pnpm-lock.yaml this step occurred at SSR, but i didn't find what relationship is between this and SSR @cspotcode thanks for helping
RangeError: Maximum call stack size exceeded
at RegExp.exec (
It does not seem to be tslog related. In fact, this library is not even used by tslog anymore and tslog is dependency free. Please open an issue with the library causing this problem (source-map-support).
It does not seem to be tslog related. In fact, this library is not even used by tslog anymore and tslog is dependency free. Please open an issue with the library causing this problem (source-map-support).
ok thanks
Describe the bug
Someone reported this bug a while back: https://github.com/cspotcode/node-source-map-support/issues/36
I see that tslog has logic to avoid infinite loops. This suggests to me that the logic might be failing in certain situations.
https://github.com/fullstack-build/tslog/blob/3b47ff2036a6e4b05eb07a64d8d0d9b7d7f48bd9/src/CallSitesHelper.ts#L42-L49
To Reproduce Steps to reproduce the behavior:
Ping @GhaithZamrik for a proper reproduction, and for all of the following details.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Node.js Version
OS incl. Version
Windows; @GhaithZamrik says it only happens on windows.