GithubHelp home page GithubHelp logo

I stumbled upon a Vike bug... about vike HOT 11 CLOSED

chrisbu avatar chrisbu commented on July 17, 2024
I stumbled upon a Vike bug...

from vike.

Comments (11)

brillout avatar brillout commented on July 17, 2024 1

try and get it to appear...

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

from vike.

brillout avatar brillout commented on July 17, 2024 1

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.

from vike.

brillout avatar brillout commented on July 17, 2024 1

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

from vike.

brillout avatar brillout commented on July 17, 2024

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

from vike.

chrisbu avatar chrisbu commented on July 17, 2024

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

from vike.

brillout avatar brillout commented on July 17, 2024

Do you have 'urlOriginal' in your passToClient?

from vike.

chrisbu avatar chrisbu commented on July 17, 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...

from vike.

chrisbu avatar chrisbu commented on July 17, 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).

from vike.

chrisbu avatar chrisbu commented on July 17, 2024

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

from vike.

brillout avatar brillout commented on July 17, 2024

👍 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).

from vike.

chrisbu avatar chrisbu commented on July 17, 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...)

from vike.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.