We have some internal modules that contain Typescript and transpiled Javascript. When importing code from a module like this from node_modules (i.e. installing a private npm package), the imported code doesn't transpile properly and causes the following Syntax Error:
SyntaxError: Unexpected token export
However, when the same code is loaded from a directory outside of node_modules, it works fine.
These modules can be imported into tests and there is no Syntax Error
Link to a minimal repo that reproduces this issue
https://github.com/bmajz/tsjestissue
Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo
This allows potential solutions to be tested against the minimal repo. This saves everyone time and avoids a lot of back and forth.
@bmajz the PR I've sent to the repo you've linked should fix this. If not, let me know and I'll reopen this
Thanks @kulshekhar!
Most helpful comment
@bmajz the PR I've sent to the repo you've linked should fix this. If not, let me know and I'll reopen this