Skip to content

AOT Compilation failing #13344

Closed
Closed

Description

@andyws

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

  1. added
    area: coreIssues related to the framework runtime
    on Dec 9, 2016
  2. vicb commented on Dec 9, 2016

    @vicb
    Contributor

    Please attach a repro

  3. MarkPerryBV commented on Dec 9, 2016

    @MarkPerryBV

    I have the same issue after upgrading my package.json deps to 2.3.0.

  4. maburdi94 commented on Dec 10, 2016

    @maburdi94

    Downgrade to typescript 2.0.2. I've struggled with this for days.

  5. andyws commented on Dec 10, 2016

    @andyws
    Author

    @maburdi94 I will try 2.0.2 as you suggest - thanks

  6. ibqn commented on Dec 10, 2016

    @ibqn

    I experience absolutely the same issue :-(
    @maburdi94 your workaround suggestion does work for me!

    I have a local dependency on typescript (from package.json)

       -     "typescript": "^2.1.4"
       +    "typescript": "2.0.10"
    

    @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.

  7. pralhadstha commented on Dec 12, 2016

    @pralhadstha

    @vicb this is the issue with the typescript newer version will work if we use 2.0.10 and below

  8. DzmitryShylovich commented on Dec 29, 2016

    @DzmitryShylovich
    Contributor

    Duplicate of #13204

  9. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimeneeds reproductionThis issue needs a reproduction in order for the team to investigate further

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions