Skip to content
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

Error with Angular Universal (ssr) #408

Closed
Agranom opened this issue Dec 12, 2017 · 10 comments
Closed

Error with Angular Universal (ssr) #408

Agranom opened this issue Dec 12, 2017 · 10 comments

Comments

@Agranom
Copy link

Agranom commented Dec 12, 2017

I'm submitting a ...

[x] Bug report 
[ ] Feature request
[ ] Support request => Please do not submit a support request here, please ask on https://stackoverflow.com/

Bug description / Feature request

I try to run calendar with server side rendering, but this error shows up:

Error: StaticInjectorError[n]: 
  StaticInjectorError[n]: 
    NullInjectorError: No provider for n!
    at _NullInjector.get (/home/vitalii/ncube/angular-calendar/dist/server.js:1264:19)
    at resolveToken (/home/vitalii/ncube/angular-calendar/dist/server.js:1552:24)
    at tryResolveToken (/home/vitalii/ncube/angular-calendar/dist/server.js:1494:16)
    at StaticInjector.get (/home/vitalii/ncube/angular-calendar/dist/server.js:1365:20)
    at resolveToken (/home/vitalii/ncube/angular-calendar/dist/server.js:1552:24)
    at tryResolveToken (/home/vitalii/ncube/angular-calendar/dist/server.js:1494:16)
    at StaticInjector.get (/home/vitalii/ncube/angular-calendar/dist/server.js:1365:20)
    at resolveNgModuleDep (/home/vitalii/ncube/angular-calendar/dist/server.js:11154:25)
    at NgModuleRef_.get (/home/vitalii/ncube/angular-calendar/dist/server.js:12382:16)
    at resolveDep (/home/vitalii/ncube/angular-calendar/dist/server.js:12880:45)

Minimal reproduction of the problem with instructions

Launch Angular Calendar with Angular Universal

Versions

Angular: 5.1.0

Calendar library: 0.22.1

Browser name and version: Chrome 62

@mattlewis92
Copy link
Owner

Please can you attach a minimal repo that demonstrates your problem, thanks!

@Agranom
Copy link
Author

Agranom commented Dec 13, 2017

https://github.com/Agranom/calendar.git

npm install
npm run build:ssr && npm run serve:ssr

@mattlewis92
Copy link
Owner

Perfect, thank you! Will try and dig in and work out whats going on when I have some free bandwidth

@AvanPhilipp
Copy link

AvanPhilipp commented Dec 14, 2017

Hello!
I've found something that may help:

WARNING in ./node_modules/angular-calendar/dist/esm/src/providers/calendarMomentDateFormatter.provider.js
2:24-35 "export 'OpaqueToken' was not found in '@angular/core'

and later:

ERROR in node_modules/angular-calendar/dist/esm/src/providers/calendarMomentDateFormatter.provider.d.ts(1,10): error TS2305: Module '"/home/fealoce/Projects/queueWeb/node_modules/@angular/core/core"' has no exported member 'OpaqueToken'.

related:
PillowPillow/ng2-webstorage#72
"OpaqueToken was deprecated with v4 and has been completely removed in v5."

Hope it helps.

@Agranom
Copy link
Author

Agranom commented Dec 14, 2017

@AvanPhilipp which version do you use? Because I can’t find that path

@AvanPhilipp
Copy link

"angular-calendar": "^0.3.3",

Updated because of an other issue. ( #68 )

@Agranom
Copy link
Author

Agranom commented Dec 14, 2017

the lates version is 0.22.1

@mattlewis92
Copy link
Owner

This turned out to be a bit of a rabbit hole, but I think this is fixed now. Please can you give the beta version a try please? npm i angular-calendar@beta. Thanks! 😄

@mattlewis92
Copy link
Owner

Finally had some free time tonight and can confirm that the beta is working nicely with universal now. Will publish 0.23.0 final tomorrow when travis is working again.

@Agranom
Copy link
Author

Agranom commented Jan 11, 2018

Great work! Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants