kmagiera / babel-watch

Reload your babel-node app on JS source file changes. And do it fast.
MIT License
528 stars 70 forks source link

error with ignored file #112

Closed TrejGun closed 3 years ago

TrejGun commented 4 years ago

i have a file which i dont want to transpile so i added it to .babelignore and now my project fails to start with error

~/node_modules/babel-watch/babel-watch.js:388
  opts.babelrc = false;
               ^

TypeError: Cannot set property 'babelrc' of null

and when i use

 --ignore server/file.ts

it throws another error

~/node_modules/babel-watch/babel-watch.js:377
    return babel.util.shouldIgnore(filename, ignore || [], only);
                      ^

TypeError: Cannot read property 'shouldIgnore' of undefined
STRML commented 4 years ago

Interesting. So the first case is expected if a file is ignored:

https://github.com/babel/babel/blob/f2af6c1170ebbea22bd29a2bae01efaec800dfe9/packages/babel-register/src/node.js#L50-L51

and we should update to handle it properly.

The second case is the same as #106 which was broken in babel 7 due to https://github.com/babel/babel/pull/5487.

@kmagiera I would like to continue maintaining this module but without publish access (or you publishing updates) - which I have been asking for, for 6+mo - none of the fixes I've committed can actually reach end users.

TrejGun commented 4 years ago

@STRML thanks for reply can you publich your fork? like @STRML/babel-watch ?

STRML commented 3 years ago

Working on this now.

STRML commented 3 years ago

Fixed in 7.2.0.

TrejGun commented 3 years ago

Thanks man! I'm happy this project got second life

STRML commented 3 years ago

Pew pew

On Tue, Jan 5, 2021 at 7:39 PM Trej Gun notifications@github.com wrote:

Thanks man! I'm happy this project got second life

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/kmagiera/babel-watch/issues/112#issuecomment-754989864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEKP2OVSM56ZTRO6ZJHS3SYOWLFANCNFSM4LCBA7OA .