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

TypeError: Cannot read property '1' of null #1481

Closed
astronomersiva opened this issue Aug 12, 2018 · 2 comments
Closed

TypeError: Cannot read property '1' of null #1481

astronomersiva opened this issue Aug 12, 2018 · 2 comments

Comments

@astronomersiva
Copy link

Stack trace:

I am getting the following error in rc5.

TypeError: Cannot read property '1' of null
    at Parser.get_tag (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/src/html/beautifier.js:276:60)
    at Beautifier.beautify (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/src/html/beautifier.js:678:37)
    at style_html (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/src/html/index.js:33:21)
    at Function.style_html (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/src/index.js:36:10)
    at makePretty (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/lib/cli.js:448:36)
    at Object.processInputSync (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/lib/cli.js:442:5)
    at Array.forEach (<anonymous>)
    at Object.exports.interpret (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/lib/cli.js:305:15)
    at Object.<anonymous> (/Users/siva/.nvm/versions/node/v8.11.3/lib/node_modules/js-beautify/js/bin/js-beautify.js:4:5)
    at Module._compile (module.js:652:30)

This happens when there is a space between the HBS opening tag and the attributes:

{{ myHelper someValue}}

Environment

OS: macOS

Settings

Example:

js-beautify -r -s=2 --wrap_line_length=150 --type=html --indent_handlebars fileName
@bitwiseman
Copy link
Member

Thanks!

@bitwiseman
Copy link
Member

Fixed in and released in 1.8.0-rc6

@bitwiseman bitwiseman modified the milestones: v1.8.x, 1.8.0-rc7 Aug 14, 2018
@bitwiseman bitwiseman modified the milestones: 1.8.0-rc8, 1.8.0 Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants