handlebars-loader icon indicating copy to clipboard operation
handlebars-loader copied to clipboard

Parse error when referencing a partial using an alias with a @ or ~ symbol

Open jefferyto opened this issue 5 years ago • 0 comments

I've set up an alias with an @ symbol, but when I try to reference a partial with it, I get a parse error. I also get the same error if the alias has the ~ (tilde) symbol.

I've created a test case here: https://github.com/jefferyto/webpack-handlebars-loader-resolve-alias-test

This is the error message I get:

ERROR in ./book-listing.handlebars
Module build failed (from ./node_modules/handlebars-loader/index.js):
Error: Parse error on line 3:
...div>  {{#books}}{{>$@aliased/book}}{{/b
----------------------^
Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'
    at Parser.parseError (/home/jeff/Code/personal/handlebars-loader/handlebars-loader-resolve-alias-test/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:267:19)
    at Parser.parse (/home/jeff/Code/personal/handlebars-loader/handlebars-loader-resolve-alias-test/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js:336:30)
    at HandlebarsEnvironment.parse (/home/jeff/Code/personal/handlebars-loader/handlebars-loader-resolve-alias-test/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js:46:43)
    at compile (/home/jeff/Code/personal/handlebars-loader/handlebars-loader-resolve-alias-test/node_modules/handlebars-loader/index.js:205:18)
    at Object.module.exports (/home/jeff/Code/personal/handlebars-loader/handlebars-loader-resolve-alias-test/node_modules/handlebars-loader/index.js:411:4)
 @ ./app.js 1:26-62

jefferyto avatar Jun 28 '19 23:06 jefferyto