Giter Club home page Giter Club logo

Comments (4)

maxwofford avatar maxwofford commented on August 10, 2024

Screen Shot 2022-01-25 at 16 12 22

from sprig.

maxwofford avatar maxwofford commented on August 10, 2024

@cedric-h: I'm not totally sure if this should have tag:bug, or tag:enhancement. Moving the error indicator to the line itself is an enhancement, but the error says it's on dispatch.js:88, which is incorrect (to the user, it's on line 7 & not in dispatch.js). Does this ticket also include fixing up the error message to mention the place the user's code errored?

from sprig.

YodaLightsabr avatar YodaLightsabr commented on August 10, 2024

I've done a bit of research and I have a few findings to report.

Because of how JavaScript new Function works, it checks for syntax errors, and since the line where it checks for the syntax error isn't in the actual code, it just says it's at new Function() and provides no more detail. However, when it's a runtime error, since it was found within the code, it shows you exactly where it is.

Syntax error: Runtime error:
Syntax error Runtime error

We might be able to get around the syntax errors by putting it through some kind of validator and showing the error from there if it finds one. For the runtime error, we would just need to parse the error string for the line number and column number, and then subtract the line by 2 (because it's starting at 3 for some reason) and the column number by 6 because it starts at 7.

from sprig.

leomcelroy avatar leomcelroy commented on August 10, 2024

Implemented this when possible with new error messages.

from sprig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.