ERROR: Cannot read property 'unshift' of undefined
See original GitHub issueI’m submitting a…
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
In package
[ ] @ng-toolkit/init
[ ] @ng-toolkit/serverless
[ ] @ng-toolkit/universal
[ ] @ng-toolkit/pwa
[ ] @ng-toolkit/firebug
Current behavior
Expected behavior
Minimal reproduction of the problem with instructions
Example repository
What is the motivation / use case for changing the behavior?
Environment
Angular version: X.Y.Z
- Node version: XX
- Platform:
Others:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:12
Top Results From Across the Web
Cannot read property 'unshift' of undefined - Stack Overflow
For the error log, it seems that this.books is not initialized. Can you initialize books variable in bookservice.ts to empty array like ...
Read more >"Cannot Read Property Unshift of Undefined" #124 - GitHub
Encounter an error about "Cannot read property unshift of undefined" ... The json parameter is an empty object & json.extends errors out to ......
Read more >Cannot read property 'unshift' of undefined while trying to ...
Coding example for the question Cannot read property 'unshift' of undefined while trying to unshift a json object-mongodb.
Read more >How to Fix TypeError: Cannot read Property 'push' of ...
When working with JavaScript arrays, you have to be careful that you are not calling the push() , pop() , shift() , unShift()...
Read more >TypeError: Cannot read property 'unshift' - Wappler Community
I am trying to see if I get a basic mobile Framework 7 blanc template running on a phone. So I created a...
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
I have resolved this problem in another thread. When you execute ng add @ng-toolkit/universal, it adds the 1.1.2 version (At least for me) so I decided to change the version to 7.1.2 which is the last version, then I deleted node_modules folder and reinstalled all dependencies with npm i. Finally I executed ng add @ng-toolkit/universal@7.1.2 and it worked
Was this getting error unshift error again so first i did npm i @ng-toolkit/universal@7.1.2 then ng add @ng-toolkit/universal@7.1.2 and it worked for me