rtsao / css-to-js-sourcemap

Generates CSS w/ sourcemaps to lines in JS at runtime
MIT License
8 stars 4 forks source link

Console errors due to `Cannot call fileName of undefined` #41

Open jonsadka opened 4 years ago

jonsadka commented 4 years ago

Any chance we can update Line 183 to include a null check for frame (i.e.if (!frame || !frame.fileName) {)? I haven't been able to track down the why of these errors, except that this error only happens after loading an external, third party JavaScript library.

The parameters being passed into const frame = ErrorStackParser.parse(stackInfo)[stackIndex]; which are causing the error are:

stackInfo = {
  "stack": "Error: stacktrace source",
  "message": "stacktrace source"
}
stackIndex = 1
frame = undefined

Screenshot

Screen Shot 2020-04-13 at 7 04 59 PM
jonsadka commented 4 years ago

This might be helpful: grepping the repo's node_modules for stacktrace source points to styletron-react exclusively. That repo uses that error in two places:

S0Lucky4Y0u commented 4 years ago

Pull please