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

Properly populate cached js filename and fix misaligned columns #528

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

legendecas
Copy link
Contributor

@legendecas legendecas commented Apr 8, 2020

Previously, the cached script doesn't properly initiate with it's correlated JS filename. The filename in stack traces will be evalmachine.<anonymous> as a result, e.g.

Error: foo
    at main (evalmachine.<anonymous>:91:15)
    at Object.423 (evalmachine.<anonymous>:92:3)
    at __webpack_require__ (evalmachine.<anonymous>:22:30)
    at startup (evalmachine.<anonymous>:37:19)
    at evalmachine.<anonymous>:41:18
    at evalmachine.<anonymous>:44:10
    at Object.<anonymous> (/workspace/out/index.js:5:28)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)

With this patch, the stack traces can be properly mapped to its correlated JS file:

Error: foo
    at main (/workspace/out/index.js.cache.js:91:15)
    at Object.717 (/workspace/out/index.js.cache.js:92:3)
    at __webpack_require__ (/workspace/index.js.cache.js:22:30)
    at startup (/workspace/out/index.js.cache.js:37:19)
    at /workspace/out/index.js.cache.js:41:18
    at /workspace/out/index.js.cache.js:44:10
    at Object.<anonymous> (/workspace/out/index.js:7:28)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

I would also like @guybedford or @sokra to take a look at this as well if they have time.

Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @legendecas for the PR!

@styfle styfle added the automerge Automatically merge PR once checks pass label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants