Skip to content

TypeError: Cannot read property 'profile' of null #6838

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
xingguangsixian opened this issue Jun 29, 2017 · 2 comments
Closed

TypeError: Cannot read property 'profile' of null #6838

xingguangsixian opened this issue Jun 29, 2017 · 2 comments

Comments

@xingguangsixian
Copy link

Versions.

@angular/cli: 1.1.1
node: 6.11.0
os: darwin x64
@angular/common: 4.2.4
@angular/compiler: 4.2.4
@angular/core: 4.2.4
@angular/forms: 4.2.4
@angular/http: 4.2.4
@angular/platform-browser: 4.2.4
@angular/platform-browser-dynamic: 4.2.4
@angular/router: 4.2.4
@angular/cli: 1.1.1
@angular/compiler-cli: 4.2.4

Repro steps.

npm start 
or
ng server

The log given by the failure.

13% building modules 31/32 modules 1 active ...client/index. 20% building modules 90/126 modules 36 active ...-ng2/src/app/base/base.component.htmlError: No module factory available for dependency type: ContextElementDependency
at Compilation.addModuleDependencies (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:206:21)
at Compilation.processModuleDependencies (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:195:8)
at _this.buildModule.err (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:336:13)
at building.forEach.cb (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:140:27)
at Array.forEach (native)
at callback (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:140:13)
at module.build (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:167:11)
at resolveDependencies (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/ContextModule.js:133:4)
at ContextModule.result.resolveDependencies (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@ngtools/webpack/src/plugin.js:229:25)
at ContextModule.build (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/ContextModule.js:103:8)
at Compilation.buildModule (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:142:10)
at factoryCallback (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:325:11)
at /Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/ContextModuleFactory.js:96:12
at /Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/tapable/lib/Tapable.js:204:11
at done.then (/Users/qunxing/work/codes/peony/one-web/o 21% building modules 94/143 modules 49 active ...de_modules/rxjs/operator/toPromise.js/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:265
if(_this.profile) {
^

TypeError: Cannot read property 'profile' of null
at factoryCallback (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/Compilation.js:265:13)
at factory (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/NormalModuleFactory.js:253:5)
at applyPluginsAsyncWaterfall (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/NormalModuleFactory.js:99:14)
at /Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/tapable/lib/Tapable.js:204:11
at NormalModuleFactory.params.normalModuleFactory.plugin (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/CompatibilityPlugin.js:52:5)
at NormalModuleFactory.applyPluginsAsyncWaterfall (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/tapable/lib/Tapable.js:208:13)
at resolver (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/NormalModuleFactory.js:74:11)
at process.nextTick (/Users/qunxing/work/codes/peony/one-web/one-ng2/node_modules/@angular/cli/node_modules/webpack/lib/NormalModuleFactory.js:205:8)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)

I have tried the angular 4.1.3 ,4.2.4 and the angular/cli 1.1.0,1.1.3 and so on ,but I only have a success for angular 4.1.3 and angular/cli 1.1.0 in the windows 10.

@filipesilva
Copy link
Contributor

Duplicate of #6417. This seems to be a problem with how your package manager installs dependencies, providing the wrong ones with a valid package.json. There's some more information in that thread.

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

2 participants