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

[BUG] Debugging experience is very poor #44

Open
resynth1943 opened this issue Dec 14, 2020 · 4 comments
Open

[BUG] Debugging experience is very poor #44

resynth1943 opened this issue Dec 14, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@resynth1943
Copy link

Describe the bug

When Rollup encounters a runtime error, it leaves you with very little to go on -- aside from a stack trace, containing mangled function names and hard-to-reach line numbers.

This doesn't really help:

[resynth@synthcave synth-di]$ time deno run --unstable --allow-read --allow-write --allow-env --allow-net https://deno.land/x/denopack@0.10.0/cli.ts --config ./build/base.config.ts
error: Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
    at Ve (https://unpkg.com/rollup@2.26.11/dist/es/rollup.browser.js:11:31514)
    at Ra (https://unpkg.com/rollup@2.26.11/dist/es/rollup.browser.js:11:318386)
    at async Ua.loadEntryModule (https://unpkg.com/rollup@2.26.11/dist/es/rollup.browser.js:11:327081)
    at async Promise.all (index 0)

To Reproduce
Steps to reproduce the behavior:

  1. Encounter a runtime error in Rollup
  2. See error

Expected behavior

You get an un-minifed error.
The Rollup module you're importing does not come with a source map, btw.

@resynth1943 resynth1943 added the bug Something isn't working label Dec 14, 2020
@resynth1943
Copy link
Author

I see two ways to fix this:

  • stop including the minified version of Rollup, and use the clear one instead
  • encourage Rollup developers to include a source-map in the bundle (I'm not sure if Deno supports source maps?)

@probins
Copy link
Contributor

probins commented Dec 29, 2020

this is surely an issue for Rollup - it ought to be simple for them to add a sourcemap to the browser output file (I'm not sure how much the browser file is actually used).

Deno supports V8 Inspector (I often use the inspect-brk option), though I think you have to use deno run - I don't think it works as an option on the installed denopack.

@resynth1943
Copy link
Author

It may be a Rollup issue, yes. Good point.

@cmorten
Copy link

cmorten commented Jan 24, 2021

FYI I have raised an issue for the particular error you reference above rollup/rollup#3934 and a PR to fix rollup/rollup#3935 in the Rollup project. Doesn’t help with the debugging aspect of this issue, but may provide some more context what the error is, why it occurs and hopefully a path forward towards fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants