angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

this._compilerHost.resolve is not a function

Open echo-sean opened this issue 8 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Node v8.11.1 NPM 6.1.0

Package Version before Version after
@angular-devkit/build-angular 0.6.8 0.7.3
@angular/animations 6.0.9 6.1.2
@angular/cli 6.0.8 6.1.3
@angular/common 6.0.9 6.1.2
@angular/compiler 6.0.9 6.1.2
@angular/compiler-cli 6.0.9 6.1.2
@angular/core 6.0.9 6.1.2
@angular/forms 6.0.9 6.1.2
@angular/language-service 6.0.9 6.1.2
@angular/platform-browser 6.0.9 6.1.2
@angular/platform-browser-dynamic 6.0.9 6.1.2
@angular/router 6.0.9 6.1.2
typescript 2.7.2 2.9.2

Repro steps

  • update Angular dependencies (as above)
  • run ng build --prod --configuration=production

The log given by the failure

this._compilerHost.resolve is not a function
TypeError: this._compilerHost.resolve is not a function
    at compiler.hooks.environment.tap (/PATH_TO_PROJECT/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:455:53)
    at SyncHook.eval [as call] (eval at create (/PATH_TO_PROJECT/node_modules/tapable/lib/HookCodeFactory.js:17:12), <anonymous>:7:1)
    at SyncHook.lazyCompileHook [as _call] (/PATH_TO_PROJECT/node_modules/tapable/lib/Hook.js:35:21)
    at webpack (/PATH_TO_PROJECT/node_modules/webpack/lib/webpack.js:40:30)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (/PATH_TO_PROJECT/node_modules/@angular-devkit/build-webpack/src/webpack/index.js:21:37)
    at Observable._trySubscribe (/PATH_TO_PROJECT/node_modules/rxjs/internal/Observable.js:43:25)
    at Observable.subscribe (/PATH_TO_PROJECT/node_modules/rxjs/internal/Observable.js:29:22)
    at /PATH_TO_PROJECT/node_modules/rxjs/internal/util/subscribeTo.js:22:31
    at Object.subscribeToResult (/PATH_TO_PROJECT/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
    at MergeMapSubscriber._innerSub (/PATH_TO_PROJECT/node_modules/rxjs/internal/operators/mergeMap.js:75:38)
    at MergeMapSubscriber._tryNext (/PATH_TO_PROJECT/node_modules/rxjs/internal/operators/mergeMap.js:72:14)
    at MergeMapSubscriber._next (/PATH_TO_PROJECT/node_modules/rxjs/internal/operators/mergeMap.js:55:18)
    at MergeMapSubscriber.Subscriber.next (/PATH_TO_PROJECT/node_modules/rxjs/internal/Subscriber.js:64:18)
    at TapSubscriber._next (/PATH_TO_PROJECT/node_modules/rxjs/internal/operators/tap.js:62:26)
    at TapSubscriber.Subscriber.next (/PATH_TO_PROJECT/node_modules/rxjs/internal/Subscriber.js:64:18)
    at MergeMapSubscriber.notifyNext (/PATH_TO_PROJECT/node_modules/rxjs/internal/operators/mergeMap.js:84:26)

Desired functionality

Build should not fail

echo-sean avatar Aug 16 '18 10:08 echo-sean

Have you tried removing the node_modules and doing a fresh re-install?

alan-agius4 avatar Aug 16 '18 10:08 alan-agius4

@alan-agius4 Yes, I have tried that - a clean install has same error.

echo-sean avatar Aug 16 '18 11:08 echo-sean

By any chance are you using Ivy, ie you have enableIvy set to one of the following true, tsc or ngtsc in your tsconfig?

alan-agius4 avatar Aug 16 '18 11:08 alan-agius4

Ah. Yes, if I remove that it works. Where did that change?

echo-sean avatar Aug 16 '18 11:08 echo-sean

Closing issue - will not use Ivy until it's stable. Thanks for the help @alan-agius4 👍

echo-sean avatar Aug 16 '18 12:08 echo-sean

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.