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

Prerendering: Cannot read properties of null (reading 'queryParams') #148

Open
GrandSchtroumpf opened this issue Feb 9, 2023 · 1 comment

Comments

@GrandSchtroumpf
Copy link

GrandSchtroumpf commented Feb 9, 2023

Hello, when I prerender my app I've got this error.

TypeError: Cannot read properties of null (reading 'queryParams')
    at containsTree (<dist-path>\server\main.js:1:3389104)
    at Array.some (<anonymous>)
    at PrefetchRegistry.shouldPrefetch (<dist-path>\server\main.js:1:3388802)
    at QuicklinkStrategy.preload (<dist-path>\server\main.js:1:3395113)
    at RouterPreloader.preloadConfig (<dist-path>\server\main.js:1:3310818)
    at RouterPreloader.processRoutes (<dist-path>\server\main.js:1:3310473)
    at RouterPreloader.processRoutes (<dist-path>\server\main.js:1:3310572)
    at RouterPreloader.processRoutes <dist-path>\server\main.js:1:3310572)
    at RouterPreloader.preload (<dist-path>\server\main.js:1:3309888)
    at <dist-path>\server\main.js:1:3309836

I guess, for some reason, the tree have some segments null on the server side :

  shouldPrefetch(url: string) {
    const tree = this.router.parseUrl(url);
    return this.trees.some(containsTree.bind(null, tree));
  }
@mgechev
Copy link
Owner

mgechev commented Feb 10, 2023

Haven't hit this one. Let me know if you find a reproduction, alternatively I can merge your fix and publish.

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

2 participants