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

Fix stack traces from worker to be rooted in ./src instead of ./dist #145

Open
woodser opened this issue Oct 3, 2023 · 0 comments
Open

Comments

@woodser
Copy link
Owner

woodser commented Oct 3, 2023

Currently stack traces for errors within the web worker are rooted in ./dist.

For example, if there is an unexpected error within MoneroWalletFull.sync(), the stack track looks like:

Error: My test error
    at LibraryUtils.deserializeError (/Users/woodser/git/monero-ts/dist/src/main/ts/common/LibraryUtils.js:262:106)
    at LibraryUtils.invokeWorker (/Users/woodser/git/monero-ts/dist/src/main/ts/common/LibraryUtils.js:251:26)
    at async MoneroWalletFullProxy.invokeWorker (/Users/woodser/git/monero-ts/dist/src/main/ts/wallet/MoneroWalletKeys.js:476:12)
    at async MoneroWalletFullProxy.sync (/Users/woodser/git/monero-ts/dist/src/main/ts/wallet/MoneroWalletFull.js:1978:24)
    at async TestUtils.getWalletFull (/Users/woodser/git/monero-ts/dist/src/test/utils/TestUtils.js:238:5)
    at async Context.<anonymous> (/Users/woodser/git/monero-ts/dist/src/test/TestSampleCode.js:32:20)
Worker error: Error: My test error
    at MoneroWalletFull.sync (/Users/woodser/git/monero-ts/src/main/ts/wallet/MoneroWalletFull.ts:565:21)
    at self.sync (/Users/woodser/git/monero-ts/src/main/ts/common/MoneroWebWorker.ts:614:11)
    at self.onmessage (/Users/woodser/git/monero-ts/src/main/ts/common/MoneroWebWorker.ts:49:49)
    1) "before all" hook for "Sample code demonstration"

The line numbers are correct but point to *.js files within monero-ts/dist.

That's because the web worker is compiled and always run from ./dist.

This issue requests fixing the stack traces (their source maps) to be rooted in monero-ts/src and with the correct *.ts extensions for worker errors.

@woodser woodser changed the title Fix stack traces / source maps within worker to be rooted in ./src instead of ./dist Fix stack traces within worker to be rooted in ./src instead of ./dist Oct 3, 2023
@woodser woodser changed the title Fix stack traces within worker to be rooted in ./src instead of ./dist Fix stack traces from worker to be rooted in ./src instead of ./dist Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant