SSR Error: inject() must be called from an injection context
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
Render a mat-primary-button
What is the current behavior?
Fails to render on server, generating a Error: inject() must be called from an injection context
error
What are the steps to reproduce?
Add material module to this repo and add a button to a random page
https://github.com/patrickmichalina/fusing-angular
Works fine on client, not server.
What is the use-case or motivation for changing an existing behavior?
To work on the server
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/animations": "6.0.0-rc.0",
"@angular/cdk": "^6.0.0-beta.5",
"@angular/common": "6.0.0-rc.0",
"@angular/compiler": "6.0.0-rc.0",
"@angular/compiler-cli": "6.0.0-rc.0",
"@angular/core": "6.0.0-rc.0",
"@angular/forms": "6.0.0-rc.0",
"@angular/http": "6.0.0-rc.0",
"@angular/material": "^6.0.0-beta.5",
"@angular/platform-browser": "6.0.0-rc.0",
"@angular/platform-browser-dynamic": "6.0.0-rc.0",
"@angular/platform-server": "6.0.0-rc.0",
"@angular/router": "6.0.0-rc.0",
"@angular/service-worker": "6.0.0-rc.0",
Node 9.9.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top Results From Across the Web
inject() must be called from an injection context - Stack Overflow
There seems to be an issue when using npm link when consuming the library. Solution: use projects.$name.architect.build.options.
Read more >NG0203: `inject()` must be called from an injection context ...
You see this error when you try to use the inject() function outside of the allowed injection context. The injection context is available...
Read more >How do I fix "Inject() must be called from an injection context"?
I had to enable "preserveSymLinks" in the Angular. json of the main project. 18 },
Read more >error: inject() must be called from an injection context - You.com
There seems to be an issue when using npm link when consuming the library. Solution: use projects.$name.architect.build.options.
Read more >Error: inject() must be called from an injection context | Angular
Error : inject() must be called from an injection context · Hi Vasili, · We have checking the diagram component with angular version...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This somehow seems to happen on second SSR render call in an example app I’m working with. Debugging…
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.