mcchatman8009 / antlr4-tool

A useful Antlr4 tool with full TypeScript support
Other
36 stars 20 forks source link

Cannot read property 'join' of undefined #3

Closed scorsi closed 6 years ago

scorsi commented 6 years ago

Hello again,

When we use the antlr4-tool cli without argument, it crashes. Generally, the help is shown by default.

MBP-de-Sylvain:ida scorsi$ antlr4-tool 
/Users/scorsi/.config/yarn/global/node_modules/antlr4-tool/dist/cli.js:32
    log(`Compiling ${antlrGrammars.join(', ')}...`);
                                   ^

TypeError: Cannot read property 'join' of undefined
    at Object.<anonymous> (/Users/scorsi/.config/yarn/global/node_modules/antlr4-tool/dist/cli.js:32:36)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/scorsi/.config/yarn/global/node_modules/antlr4-tool/dist/app.js:2:1)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
scorsi commented 6 years ago

Did you regenerates the dist folder ? Maybe juste send the src folder and remove the npm run build task ? Because when I run it with the npm package, it fails, but when I run it from sources node src/cli.js it's good.

You also can use https://github.com/typicode/husky to automaticaly build dist folder before git push for example.

mcchatman8009 commented 6 years ago

Sorry, try running the install globally again. I just pushed out version 1.0.12

mcchatman8009 commented 6 years ago

Thanks again @scorsi