Skip to content

More informative syntax errors #8

@toji

Description

@toji

Currently if a required script has a syntax error you will receive a only slightly helpful message along the lines of:

Uncaught SyntaxError: Unexpected token , in http://localhost:8000/your-huge-script.js

This usually includes a link to the throw statement in require.js makeRequire. Unfortunately that's simply not enough information to effectively locate and fix the syntax error, which means you spend a lot of time scanning through the file line by line for errant commas or periods.

If there's any way to include a line number or at least some surrounding code in this error message it would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions