Skip to content

AoT compilation not working #2882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scarmarco opened this issue Oct 25, 2016 · 12 comments
Closed

AoT compilation not working #2882

scarmarco opened this issue Oct 25, 2016 · 12 comments

Comments

@scarmarco
Copy link

I'm getting this error everytime I build/serve with --aot option.

angular/angular#9663 Same issue like this, but on Sierra.

ng serve --aot
Looks like you have a different program called watchman, falling back to NodeWatcher.
Visit http://ember-cli.com/user-guide/#watchman for more info.
can't resolve module @angular/core/src/di/opaque_token from /Users/.../src/index.ts
Cannot read property 'parse' of undefined
TypeError: Cannot read property 'parse' of undefined
at ReflectorHost.normalizeAssetUrl (/Users/iminar/Dev/angular/modules/@angular/compiler-cli/src/reflector_host.ts:70:28)
at ReflectorHost.findDeclaration (/Users/iminar/Dev/angular/modules/@angular/compiler-cli/src/reflector_host.ts:175:27)
at StaticReflector.initializeConversionMap (/Users/iminar/Dev/angular/modules/@angular/compiler-cli/src/static_reflector.ts:185:34)
at new StaticReflector (/Users/iminar/Dev/angular/modules/@angular/compiler-cli/src/static_reflector.ts:72:57)
at AotPlugin._setupOptions (/.../node_modules/@ngtools/webpack/src/plugin.js:122:27)
at new AotPlugin (/.../node_modules/@ngtools/webpack/src/plugin.js:34:14)
at Object.exports.getWebpackAotConfigPartial (/Users/marco/Documents/github/v4/node_modules/angular-cli/models/webpack-build-typescript.js:57:13)
at new NgCliWebpackConfig (/.../node_modules/angular-cli/models/webpack-config.js:18:42)
at Class.run (/.../node_modules/angular-cli/tasks/serve-webpack.js:21:22)
at /.../node_modules/angular-cli/commands/serve.js:92:26
at process._tickCallback (internal/process/next_tick.js:103:7)

OS?

Mac OSX Sierra

Versions.

angular-cli: 1.0.0-beta.18
node: 6.9.1
os: darwin x64

@inska
Copy link

inska commented Oct 26, 2016

Similar here.
Which version do you using Typescript? 2.1.0 dev?

@brendanalexdr
Copy link

same here

@simonh1000
Copy link

simonh1000 commented Oct 26, 2016

Same here
angular-cli: 1.0.0-beta.18
node: 6.3.1
os: darwin x64 El Capitan

  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "latest",
    "codelyzer": "~1.0.0-beta.0",
    "deep-freeze": "0.0.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.7.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "ts-node": "1.4.0",
    "tslint": "3.15.1",
    "typescript": "2.0.3"
  }

@zackarychapple
Copy link
Contributor

Try dumping node modules and installing again. I didn't run into this issue with the same OS and versions.

@simonh1000
Copy link

simonh1000 commented Oct 26, 2016

I upgraded everything (ncu -u) and reinstalled. Compilation now completes, but with an error midway that makes the code unrunable

ERROR in ./src/app/app.module.ngfactory.ts
Module build failed: TypeError: Cannot read property 'replace' of undefined
    at Object.normalizeSlashes (/Users/simon/code/wp_af2015/wp-content/themes/af2016/afapp/node_modules/typescript/lib/typescript.js:1766:20)

Update Have replicated the problem with Ubuntu and Node 6.9

@wachh
Copy link

wachh commented Oct 26, 2016

having the same issue on Ubuntu

@scarmarco
Copy link
Author

Try dumping node modules and installing again. I didn't run into this issue with the same OS and versions.

Tried that, no success :(

Which version do you using Typescript? 2.1.0 dev?

I'm on Typescript 2.0.2

I upgraded everything (ncu -u) and reinstalled. Compilation now completes, but with an error midway

Do you mind explain exactly what you did?

Dependencies for better context

Project dependencies

@wachh
Copy link

wachh commented Oct 26, 2016

I used npm-check-updates to update all my dependencies and the issue is gone. However I ran into this other issue #2452

@scarmarco
Copy link
Author

scarmarco commented Oct 27, 2016

@wachh Ok it worked!

Ok, seems to be compilating but... I'm getting:

23% building modules 112/112 modules 0

and keeps stuck there.

@Destreyf
Copy link

@scarmarco Compile without the aot flag, you'll find you have an error in your code (or a dependency) that is causing aot to get stuck.

@filipesilva
Copy link
Contributor

Closing since it seems like an Angular Compiler bug itself, as reported on angular/angular#9663.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants