Comments (8)
Just checking in to report that this issue still occurs with the new RegExp in very obscure scenarios. In the case I encountered, it was caused by this line in the emotion/react repo's createEmotionProps
function that uses new Error().stack
to update component labels while performing SSR builds with ts-node and next.js.
Interestingly, I was able to intercept the specific file data that caused the error by using local builds of ts-node
and a local build of the fork of this repo @cspotcode/source-map-support
that ts-node
uses, and was not able to reproduce the RangeError
with this regex independently with just Node.js.
However, overriding Error.prepareStackTrace
to skip source-map-support
's sourcemap transformation logic for stack traces demanded by createEmotionProps
reliably resolves the error for me:
if (Error.prepareStackTrace) {
const originalPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function (error, trace) {
if (error.stack?.includes('createEmotionProps')) {
return error.stack;
}
return originalPrepareStackTrace(error, trace);
};
}
Based on this V8 bug I think RegExp.exec
only throws RangeError: Maximum call stack size exceeded
when backtracking often over large strings, so I think the current RegExp
may still be too greedy for certain large inputs.
from node-source-map-support.
This issue is still present. Are there any plans for fixing this?
Here's more detailed stacktrace, if it helps:
"RangeError: Maximum call stack size exceeded"
"at RegExp.exec (<anonymous>)",
"at RegExp.[Symbol.match] (native)",
"at String.match (native)",
"at urlParse (/myproject/node_modules/source-map-support/node_modules/source-map/lib/util.js:33:20)",
"at normalize (/myproject/node_modules/source-map-support/node_modules/source-map/lib/util.js:82:13)",
"at Object.join (/myproject/node_modules/source-map-support/node_modules/source-map/lib/util.js:174:7)",
"at BasicSourceMapConsumer.SourceMapConsumer_originalPositionFor [as originalPositionFor] (/myproject/node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:621:27)",
"at mapSourcePosition (/myproject/node_modules/source-map-support/source-map-support.js:195:42)"
from node-source-map-support.
This should be fixed in version 0.5.13
, please report back if the issue persists!
from node-source-map-support.
Whoops, just realised this will probably be fixed by #86. Will check tomorrow.
from node-source-map-support.
I can confirm I have the same issue. It happens randomly i.e. not every run.
The line that causes it for me is when executing the regex:
/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg
- node-source-map-support: 0.4.16
- Ionic App
- karma-source-map-support: 1.2.0
- jasmine: 2.7.0
from node-source-map-support.
This is still a problem with Angular 7 unit tests, which uses jasmine, karma, and webpack and creates very large bundles, on a small project, the bundle for vendor.js is over 17MB.
from node-source-map-support.
I agree with @telb99. This i still an issue in Angular 8 and needs fixing. @LinusU, please resolve.
from node-source-map-support.
Happy to receive a PR for this 🙌
from node-source-map-support.
Related Issues (20)
- lib throws error with "Cannot read property 'isNative' of undefined" HOT 2
- Problems with Node 12 on Windows
- Removes error code from node errors HOT 2
- [meta] are tests running on CI? HOT 1
- Format the output so it can be clicked HOT 1
- decodeURI for chinese filename
- Using source map support removes details from some errors HOT 1
- TypeError: Cannot read property 'String' of undefined HOT 1
- Cannot find module when `import "source-map-support/register"` HOT 2
- Leaking event hooks which prevents process from exiting
- Error still show compiled code
- Error still show compiled code
- Source-map needs to be updated to 0.8.0-beta.0 HOT 1
- RangeError Maximum call stack size exceeded when testing Vue project HOT 1
- `lastIndexOf` in `sourcemap-register.js` causes Github to flag `Incorrect suffix check` HOT 4
- document that this package is no longer needed as of node 12.12.0
- WASM traces do not correspond to expected offsets HOT 2
- Provide esm version HOT 2
- Dependency of some other major open source projects
- Is there Micro Frontend support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-source-map-support.