Repository navigation
Description
I'm submitting a ... (check one with "x")
[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
AOT compilation fails with "Error at .../src/apps/appv1/aot/main.ts:3:36: Cannot find module '../../../ngfactory/src/apps/appv1/app.module.ngfactory'". ie codegen fails foor my code but not node_modules.
Specifically an exception is being thrown in tsc-wrapped/src/main.js at the line:
tsc_1.tsc.typeCheck(host_1, programWithCodegen);
The exception is "_nativeError"
Expected behavior
That the AOT compiler will codegen code for my modules as well as for items in node_modules
Minimal reproduction of the problem with instructions
Run AOT with this tsconfig:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"removeComments": true,
"skipLibCheck": true,
"strictNullChecks": true,
"diagnostics": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"allowUnreachableCode": false,
"outDir": "build",
"typeRoots": [
"node_modules/@types"
],
"types": [
"core-js"
]
},
"exclude": [
"node_modules",
"3P",
"config",
"./src/apps/appv1/jit",
"./src/apps/appv2/"
],
"angularCompilerOptions": {
"genDir": "./src/ngfactory",
"skipMetadataEmit": true,
"debug": true
}
}
What is the motivation / use case for changing the behavior?
AOT Compilation was working before upgrading to 2.3.0/0.4.2
Please tell us about your environment:
W10 NPM3.10.8 Node: 7.0.0
-
Angular version: 2.0.X
2.3.0 -
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web
ALL -
Language: [all | TypeScript X.X | ES6/7 | ES5]
Typescript 2.1.4 -
Node (for AoT issues):
node --version=
compiler-cli: 2.3.0
tsc-wrapped: 0.4.2
Activity
vicb commentedon Dec 9, 2016
Please attach a repro
MarkPerryBV commentedon Dec 9, 2016
I have the same issue after upgrading my package.json deps to 2.3.0.
maburdi94 commentedon Dec 10, 2016
Downgrade to typescript 2.0.2. I've struggled with this for days.
andyws commentedon Dec 10, 2016
@maburdi94 I will try 2.0.2 as you suggest - thanks
ibqn commentedon Dec 10, 2016
I experience absolutely the same issue :-(
@maburdi94 your workaround suggestion does work for me!
I have a local dependency on typescript (from package.json)
@vicb you can have a look at this sample project https://github.com/ibqn/ng2-router-gulp
if you want to reproduce the issue, do update typescript version to 2.1.4.
pralhadstha commentedon Dec 12, 2016
@vicb this is the issue with the
typescriptnewer version will work if we use 2.0.10 and belowDzmitryShylovich commentedon Dec 29, 2016
Duplicate of #13204
angular-automatic-lock-bot commentedon Sep 10, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.