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 in Angular 8 dynamic import #101

Closed
s-mizoguchi opened this issue Jul 17, 2019 · 3 comments
Closed

Error in Angular 8 dynamic import #101

s-mizoguchi opened this issue Jul 17, 2019 · 3 comments

Comments

@s-mizoguchi
Copy link

Transitions and errors occur on pages lazily loaded with dinamyc import.

ERROR { Error: Uncaught (in promise): TypeError: Cannot read property 'call' of undefined
TypeError: Cannot read property 'call' of undefined
    at __webpack_require__ (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:145323:30)
    at Function.requireEnsure [as e] (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:145342:25)
    at ɵ0 (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:145537:38)
    at RouterConfigLoader.loadModuleFactory (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:149667:39)
    at RouterConfigLoader.load (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:149652:35)
    at MergeMapSubscriber.project (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:148655:47)
    at MergeMapSubscriber._tryNext (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:35790:27)
    at MergeMapSubscriber._next (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:35780:18)
    at MergeMapSubscriber.Subscriber.next (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:32339:18)
    at Observable._subscribe (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:34351:24)
    at resolvePromise (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45498:31)
    at resolvePromise (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45455:17)
    at /Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45559:17
    at ZoneDelegate.invokeTask (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45069:31)
    at Object.onInvokeTask (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:27526:33)
    at ZoneDelegate.invokeTask (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45068:60)
    at Zone.runTask (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:44841:47)
    at drainMicroTaskQueue (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45247:35)
    at ZoneTask.invokeTask (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45148:21)
    at Server.ZoneTask.invoke (/Users/s-mizoguchi/Projects/universal-nest/dist/server.js:45133:48)

Update of Angular 8 looks inadequate #66

Is this upgrade guide compatible?

https://github.com/angular/universal/blob/master/docs/v8-upgrade-guide.md

@kamilmysliwiec
Copy link
Member

I'll take a look at this shortly

@s-mizoguchi
Copy link
Author

Thank you for your quick reply.

This will reproduce.

$ git clone https://github.com/kamilmysliwiec/universal-nest.git
$ cd universal-nest && npm i
$ npm run build:ssr && npm run serve:ssr

# An error occurs when transitioning to the speakers.

Due to this problem, I can not set dynamic title and meta on the server side.

  constructor(private title: Title, private meta: Meta) { }

  ngOnInit() {
    this.title.setTitle('Some Title');
    this.meta.addTag({ name: 'description', content: 'Some description' });
  }

@kamilmysliwiec
Copy link
Member

Fixed in @nestjs/ng-universal@2.0.0. I have also updated universal-starter repo :) For existing apps, update all packages + follow this:
https://github.com/angular/universal/blob/master/docs/v8-upgrade-guide.md (only 1 bullet) + remove enableProdMode() from main.ts

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

No branches or pull requests

2 participants