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

What is the easiest way to debug an error on RS? #129

Open
rafi16jan opened this issue Feb 16, 2019 · 4 comments
Open

What is the easiest way to debug an error on RS? #129

rafi16jan opened this issue Feb 16, 2019 · 4 comments

Comments

@rafi16jan
Copy link

Hey Kovid, it's been years since I've been developing with RapydScript and it really helps me in many things. Thanks for your work. Just one quick question, what's the best way to debug RapydScript errors? Especially the runtime errors not the compilation error (since the compiler points the direct code). Because first the javascript itself doesn't print the exact code line if the error is from a Promise, and then after searching for the code that cause the error with catch, it's a transpiled javascript which is harder to read for beginners (especially one who haven't know javascript or even new ES6 javascript developers can't seem to understand too). Because this bugs us a lot. It's actually not a problem for me but my colleagues depends on me in debugging the errors, I'm a bit confused about were they the one that weren't smart enough or I that was forcing them to use RS was silly.

This is actually a personal issue but I want to clear them up, do you have any suggestion? Maybe should I integrate RS to webpack? Or is it easy to add map files to RS?

@kovidgoyal
Copy link
Owner

Personally, I have no problems reading the transpiled JS that RS produces, so I have no motivation to implemnt map files. But certainly in principle they could be implemented. But it is going to require work from someone other than me, i'm afrad.

@rafi16jan
Copy link
Author

@kovidgoyal me too, but not everyone are able to read it that easy. Can you give me some instruction or references to make source map files?

@rafi16jan
Copy link
Author

I came accross this: https://github.com/mozilla/source-map

Turnout its not that easy to make source maps. Either you have to read the ast per line, or you pin point the compiled and original code line and column yourself...

@kovidgoyal
Copy link
Owner

kovidgoyal commented Feb 17, 2019

All ast elements in RS contain line and column information for use in error messages, should not be hard to translate that into map files.

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

2 participants