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
I recently experienced a regression after upgrading from v7.0.0 to v7.4.0, where I received the following error without any config change:
/Users/timorthi/.../tcomb/common.js:1
import t from 'tcomb';
^
SyntaxError: Unexpected identifier
My startup command was: babel-watch --inspect --use-polling --extensions '.ts, .js' server
After some digging, I realized that the format in which I wrote out my --extensions option was incorrect. The only reason why my command worked as I'd expected is that the program.extensions was being concatenated with babel.DEFAULT_EXTENSIONS. Meaning, at runtime, my config looked something like
transpileExtensions = [
'.ts', // from --extensions
' .js', // from --extensions
'.js', // from babel defaults
]
The ' .js' obviously didn't do anything helpful, but the invalid .js was "saved" by the concatenation of Babel defaults.
This concat was removed in v7.2.0 (line 105): 7b5eee6
and so produced the error above.
This was a pretty subtle error to catch, so I figured I'd bring it up here for anyone who encountered the same issue.
My thoughts are either to 1) bring back the concatenation of Babel defaults (if it's not breaking), 2) trim whitespace in arrayify, or 3) at least specify in the docs that the --extensions option should not contain whitespace.
The text was updated successfully, but these errors were encountered:
Hi,
I recently experienced a regression after upgrading from v7.0.0 to v7.4.0, where I received the following error without any config change:
My startup command was:
babel-watch --inspect --use-polling --extensions '.ts, .js' server
After some digging, I realized that the format in which I wrote out my
--extensions
option was incorrect. The only reason why my command worked as I'd expected is that theprogram.extensions
was being concatenated withbabel.DEFAULT_EXTENSIONS
. Meaning, at runtime, my config looked something likeThe
' .js'
obviously didn't do anything helpful, but the invalid.js
was "saved" by the concatenation of Babel defaults.This concat was removed in v7.2.0 (line 105):
7b5eee6
and so produced the error above.
This was a pretty subtle error to catch, so I figured I'd bring it up here for anyone who encountered the same issue.
My thoughts are either to 1) bring back the concatenation of Babel defaults (if it's not breaking), 2) trim whitespace in
arrayify
, or 3) at least specify in the docs that the--extensions
option should not contain whitespace.The text was updated successfully, but these errors were encountered: