"esnext" will prevent
ts-node from converting
import statements which causes node to crash with a
ts-nodeautomatically loads the
tsconfig.jsonunless it’s explicitly told not to (link)
- and the
tsconfig.jsonfile isn’t necessarily configured to produce node-compatible code,
what can happen is that the
gulpfile.ts file is transpiled into code that isn’t executable by node.
This kind of problem can occur whenever the build target supports features that the local node version doesn’t and one of those features are used inside the
gulpfile.ts (which in my case was the
My solution to this problem would be to prevent
ts-node to load the
tsconfig.json by setting the environment variable
true, this would make it fall back to the defaults options which are to produce ES3+CommonJS code.