-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ncc@0.11.0 typescript error #237
Comments
I'm having this exact issue. Same versions on everything except I'm using NPM, so it's definitely not specific to Yarn |
Try installing |
Indeed, running Thanks @samkcarlile! |
I have the same issue. node: v10.15.0 ncc is installed globally. Installing typescript globally solves it for me. Installing it locally gives me the error. Installing both locally and running ncc via npx works as well. Seems like they must both be installed at the same location. |
Looks like the issue might stems from here https://github.com/zeit/ncc/blob/master/src/loaders/ts-loader.js#L21 which after #233 is no longer working. Looks like const tsId = require.resolve("typescript"); to const tsId = getTsId();
// ...
function getTsId() {
try {
return require.resolve('typescript');
}
catch (e) {
return require.resolve(__dirname + "/../../dist/ncc/typescript/typescript.js");
}
} |
The included typescript example throws a build error for me using
0.11.0
but compiles fine with0.9.0
.If I change package.json to have
"@zeit/ncc": "0.9.0"
, the build works as intended.I was getting this error in a more complicated scenario, so I tried the built-in typescript example and got the same results.
I'm guessing this was introduced in 208cdc0.
I do have
typescript
installed globally.tsc --version
yields3.2.4
.node: v10.3.0
yarn: 1.13.0
macOS High Sierra 10.13.6
cc @guybedford @rauchg
The text was updated successfully, but these errors were encountered: