You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a hidden file containing illegal tokens in database/migrations, the ace migrate commands fail.
Steps to reproduce
On MacOS, delete a file from the migrations directory in finder, then restore it from the trash. This creates a .DS_store file, which contains invalid characters. Then using any migration command exits with error SyntaxError: Invalid or unexpected token
There could be other situations that create bad .DS_store files.
I believe it is a zero-width space (U+200B) that causes it to throw the syntax error.
use require-all instead of auto-loader, since autoloader select all files before filtering them,
which causes an error when a non-js file is loaded
Closes#96
When there is a hidden file containing illegal tokens in database/migrations, the ace migrate commands fail.
Steps to reproduce
On MacOS, delete a file from the migrations directory in finder, then restore it from the trash. This creates a .DS_store file, which contains invalid characters. Then using any migration command exits with error
SyntaxError: Invalid or unexpected token
There could be other situations that create bad .DS_store files.
I believe it is a zero-width space (U+200B) that causes it to throw the syntax error.
Possible solution
It breaks on this line, when it tries to map the files - https://github.com/adonisjs/adonis-lucid/blob/develop/lib/util.js#L286
It would be solved by filtering out hidden files before loading all files in the directory, I'm not sure of the best method for this though.
I also noticed the docblock on the loadJsFiles method is missing a param
The text was updated successfully, but these errors were encountered: