Skip to content

parseError fails when module source is missing #1491

@lordnox

Description

@lordnox

Version:

@sentry/node
4.0.0-beta.12

Description

When throwing an Error that contains a module in its stacktrace which was compiled from typescript to javascript with sourcemaps, the function readSourceFiles throws an error.
This error is not caught and triggers another captureExeption call, which obfuscates the real problem.

Example

The error initially thrown is: Error: Resolve function for "Subscription.numberChanged" returned undefined
With the first line in its stacktrace being: at /Users/.../node_modules/graphql-tools/src/makeExecutableSchema.ts:104:13
This will be shown when I catch the error and do a console.error to show it in the console.
However, when viewing it on sentry.io it is converted into: Error: ENOENT: no such file or directory, open '/Users/.../node_modules/graphql-tools/src/makeExecutableSchema.ts'

This happens because graphql-tools does not ship the source with it, and relies on the dist folder + sourcemaps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions