uetchy / create-create-app

⚡️ Create your own `create-something` app.
MIT License
94 stars 24 forks source link

Readable error message #44

Open goulu opened 2 years ago

goulu commented 2 years ago

while running my create-app with a new template I created I get this error

Parse error on line 50:
...d. For example, `{{a}` will match `['{',
-----------------------^
Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'

Error: Parse error on line 50:
...d. For example, `{{a}` will match `['{',
-----------------------^
Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'
    at Parser.parseError (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\parser.js:267:19)
    at Parser.parse (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\parser.js:336:30)
    at parseWithoutProcessing (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\base.js:46:33)
    at HandlebarsEnvironment.parse (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\base.js:52:13)
    at compileInput (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:508:19)
    at ret (C:\dev\create-create-app\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:517:18)
    at Q (C:\dev\create-create-app\lib\index.js:1:3869)
    at ie (C:\dev\create-create-app\lib\index.js:1:4383)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Be (C:\dev\create-create-app\lib\index.js:2:52)

I guess I have a problem in one of the template files, but which one ?
I wanted to catch this error and issue a clearer message bout couldn't manage to launch create(-create)-app with a debugger...
Is there a launch.json configuration for VSCode that would work ?
goulu commented 2 years ago

Found ! I had mistakenly run npm install in the template dir, so there were node_modules there ...

Anyway, a clearer message would have helped ...