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

Tanstack start: router context is coming out null #3002

Open
adgang opened this issue Dec 13, 2024 · 2 comments
Open

Tanstack start: router context is coming out null #3002

adgang opened this issue Dec 13, 2024 · 2 comments

Comments

@adgang
Copy link

adgang commented Dec 13, 2024

Which project does this relate to?

Start

Describe the bug

I was just playing with to get @tanstack/start to work with deno. I created an app with ssr.

When hitting http://localhost:3000, the server seems to log a response but the page keeps loading forever. Even curl keeps waiting forever:

curl http://localhost:3000 --verbose
* Host localhost:3000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:3000...
* connect to ::1 port 3000 from ::1 port 58800 failed: Connection refused
*   Trying 127.0.0.1:3000...
* Connected to localhost (127.0.0.1) port 3000
> GET / HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off

Server logs:

vinxi hook app:dev:nitro:config                                                                                                    6:26:58 AM
vinxi hook app:dev:server:created                                                                                                  6:26:58 AM
vinxi hook app:dev:server:listener:creating                                                                                        6:26:58 AM

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

vinxi hook app:dev:server:listener:created                                                                                         6:26:58 AM
ServerFn Request: /Users/adgang/ws/development/others/deno-tanstack-start/app/routes/index.tsx - $$function0

ServerFn Response: 200
 - Payload: {"result":0,"context":{}}
Warning: useRouter must be used inside a <RouterProvider> component!
Warning: useRouter must be used inside a <RouterProvider> component!
Error in renderToPipeableStream: TypeError: Cannot read properties of null (reading '__store')
    at useRouterState (file:///some-path/deno-tanstack-start/node_modules/.deno/@[email protected]/node_modules/@tanstack/react-router/dist/esm/useRouterState.js:11:26)
    at OutletImpl (file:///some-path/deno-tanstack-start/node_modules/.deno/@[email protected]/node_modules/@tanstack/react-router/dist/esm/Match.js:162:19)
    at Object.react-stack-bottom-frame (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:8723:18)
    at renderWithHooks (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:4621:19)
    at renderElement (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:5056:23)
    at renderElement (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:5406:15)
    at retryNode (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:5704:22)
    at renderNodeDestructive (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:5530:11)
    at renderNode (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:6080:18)
    at renderChildrenArray (file:///some-path/deno-tanstack-start/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server.node.development.js:5965:9) { componentStack: [Getter] }

Warning: The line numbers above are not faithful to the code lines in the npm package as I have changed somethings in node_modules to debug the issue.

Please keep this issue open so that we can track and fix these issues.

Your Example Website or App

https://github.com/adgang/deno-tanstack-start

Steps to Reproduce the Bug or Issue

See https://github.com/adgang/deno-tanstack-start
To reproduce the issue,

  1. Clone the repo
  2. git checkout 292f6c02921060444f6c783fc261ab1e775f70f0
  3. deno -i --allow-scripts
  4. DEBUG=true deno run devv --debug -debug --allow-scripts
    Note: devv has two vs.

Expected behavior

The count page in app starter should work.

Screenshots or Videos

Page doesn't load. So no screenshots.

Platform

  • OS: [MacOS]
  • Browser: [Chrome]
  • Version: [131.0.6778.139]
  • Deno 2.1.3
    Any browser can reproduce this.
deno --version
deno 2.1.3 (stable, release, aarch64-apple-darwin)
v8 13.0.245.12-rusty
typescript 5.6.2

Additional context

No response

@schiller-manuel
Copy link
Contributor

can you check if multiple versions of router are installed somehow by deno?

@osdiab
Copy link

osdiab commented Dec 15, 2024

seems to happen in particular with Deno and not when I run with npm or with bun.

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