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

CLI compile-folder exception when data is invalid #2029

Closed
lucasff opened this issue Aug 25, 2020 · 2 comments
Closed

CLI compile-folder exception when data is invalid #2029

lucasff opened this issue Aug 25, 2020 · 2 comments
Assignees
Labels

Comments

@lucasff
Copy link

lucasff commented Aug 25, 2020

In @formatjs/cli if any of the source JSON used to be processed by the compile-folder command, this exception is thrown:

TypeError: Cannot read property 'charCodeAt' of undefined
    at peg$parseselfClosingTag (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:722:19)
    at peg$parsetagElement (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:681:14)
    at peg$parsemessageElement (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:453:18)
    at peg$parsemessage (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:434:14)
    at peg$parsestart (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:428:14)
    at Object.peg$parse [as pegParse] (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/src/parser.js:3124:18)
    at Object.parse (node_modules/@formatjs/cli/node_modules/intl-messageformat-parser/index.js:31:24)
    at Object.<anonymous> (node_modules/@formatjs/cli/src/compile.js:97:62)
    at step (node_modules/@formatjs/cli/src/compile.js:33:23)
    at Object.next (node_modules/@formatjs/cli/src/compile.js:14:53)

Expected behavior
I'd expect the error to be nicer, maybe informing the file and/or key that fails?

@lucasff lucasff added the bug label Aug 25, 2020
@longlho
Copy link
Member

longlho commented Aug 25, 2020

Yup thanks a lot for reporting we'll take a look

@longlho
Copy link
Member

longlho commented Aug 25, 2020

@pyrocat101 can you help?

@pyrocat101 pyrocat101 self-assigned this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants