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

I stumbled upon a Vike bug... #1720

Closed
chrisbu opened this issue Jun 27, 2024 · 11 comments
Closed

I stumbled upon a Vike bug... #1720

chrisbu opened this issue Jun 27, 2024 · 11 comments
Labels

Comments

@chrisbu
Copy link

chrisbu commented Jun 27, 2024

Description

Per console output... please let me know if you need anything more.

Uncaught (in promise) Error: [[email protected]][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours).
createErrorWithCleanStackTrace createErrorWithCleanStackTrace.js:4
assert assert.js:54
renderPageNominal renderPageClientSide.js:105
renderPageClientSide renderPageClientSide.js:31
render installClientRouter.js:21
installClientRouter installClientRouter.js:13
entry.js:9
createErrorWithCleanStackTrace.js:4:16

@brillout
Copy link
Member

brillout commented Jun 27, 2024

What's the assert() line that is failing? It should be at the third stack trace entry renderPageNominal renderPageClientSide.js:105.

@chrisbu
Copy link
Author

chrisbu commented Jun 27, 2024

Its this: assert(!('urlOriginal' in pageContextRouted));

@brillout
Copy link
Member

Do you have 'urlOriginal' in your passToClient?

@chrisbu
Copy link
Author

chrisbu commented Jun 27, 2024

Aah, it was me. I'm trying to get this https://github.com/brillout/vike-with-redux working with a generated bati project, but the "Link.tsx" is giving me an error about urlPathname is undefined, and I was tinkering with the passToClient (and put urlOriginal in there to try and get it to appear...

@brillout
Copy link
Member

try and get it to appear...

Hm, it actually should be there. Let me have a quick look.

@chrisbu
Copy link
Author

chrisbu commented Jun 27, 2024

I was looking at this bit of the docs: https://vike.dev/pageContext#built-in

On the client-side:
.
When using Client Routing, the value of pageContext.urlOriginal is the browser's current URL (window.location.href).
When using Server Routing, the value of pageContext.urlOriginal is undefined (unless you use passToClient).

@brillout
Copy link
Member

I cannot reproduce. When clientRouting: true then it's defined on my side. Reproduction welcome and I'll dig into it.

FYI the Redux docs got updated yesterday: https://vike.dev/redux.

@chrisbu
Copy link
Author

chrisbu commented Jun 27, 2024

Thanks - I'll dig around and see what I'm doing wrong.

@chrisbu chrisbu closed this as completed Jun 27, 2024
@brillout brillout reopened this Jun 27, 2024
@brillout
Copy link
Member

👍 Let me know if you believe there is a bug on Vike's side. Also in case your company is up for it, we're looking for sponsors (#1350).

@chrisbu
Copy link
Author

chrisbu commented Jun 27, 2024

Thanks. I'm not sure if it's a bug or maybe just an out-of-date example.

Minimal example here: https://github.com/chrisbu/vike-1720
Basically, bati with --react --express (plus redux react-redux packages), and then pages from this folder: https://github.com/brillout/vike-with-redux_minimal-example/tree/main/renderer into the /renderer folder.

That gives me the error TypeError: Cannot destructure property 'urlPathname' of 'pageContext' as it is undefined. which was what I was trying to track down that led to me trying to add urlOriginal. Happy to open a new bug on the vike-with-redux... project if better place than this bug report. (also happy to help with documententation once I get my head around it...)

@brillout
Copy link
Member

This looks like a user land issue, not a Vike one.

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

No branches or pull requests

2 participants