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
The problem was caused by some contents of the node_modules folder in the TypeScript repo folder.
If we don't build by specifying a tsconfig.json file at the command-line, it appears node modules are automatically loaded by walking up from the working directory, following the rules on the module resolution page.
It's unclear to me why, philosophically, any modules are searched for at all.
Building from a path that doesn't include the TypeScript repo prevents us from loading the problematic node module.
Workarounds:
call tsc.js from a working directory that doesn't include the offending node_modules along the path. Ie: don't issue the build command while in the TypeScript repo.
the node_modules@types are automatically included. some of them depend on ES6 objects. so you get this error. I plan to discuss this in the next design meeting under #11396
TypeScript Version: master, commit 8ad68ad
Reproduced on Win10 and Ubuntu 16.04.
Code
Note: this initially appeared with nonempty files, but I tried to minimize the repro.
Create an empty file called "empty.ts" in a folder without tsconfig.json or anything else
rm -rf node_modules
in the typescript reponpm install
and (in case you didn't have it before)npm install -g jake
build typescript with 'jake local'
Run
node /path/to/built/local/tsc.js /path/to/anything.ts
from the TypeScript repo folder.Expected behavior:
Compiles successfully.
Actual behavior:
Fails with the following errors:
The text was updated successfully, but these errors were encountered: