Skip to content

No HTTPEvent found in AsyncLocalStorage #4408

Closed as not planned
Closed as not planned

Description

@elvc

Which project does this relate to?

Start

Describe the bug

I ran into the following bug after following the "devinxi" guide and upgrading the packages to the following version.

    "@tanstack/react-query": "^5.80.7",
    "@tanstack/react-query-devtools": "^5.80.7",
    "@tanstack/react-router": "^1.121.2",
    "@tanstack/react-router-devtools": "^1.121.5",
    "@tanstack/react-router-with-query": "^1.121.2",
    "@tanstack/react-start": "^1.121.7",

After double checking the official examples, I noticed that they are also having the same issues:

Running the official Start Clerk Basic example in Stackblitz results in an immediate crash when starting the dev server. The error appears to originate from the TanStack Start server runtime.

It seems to happen in other Examples as well such as Start Basic React Query

Your Example Website or App

https://stackblitz.com/github/tanstack/router/tree/main/examples/react/start-clerk-basic?embed=1&theme=dark&preset=node&file=src/routes/__root.tsx

Steps to Reproduce the Bug or Issue

  1. Open the official Start Clerk Basic example in Stackblitz or clone the repo
  2. Run npm install
  3. Run npm run dev
  4. Navigate to http://localhost:3000/
  5. App crashes and error messages in the terminal as seen in screenshot (No HTTPEvent found in AsyncLocalStorage)

Expected behavior

The application should launch without runtime errors and render the homepage with Clerk authentication integration.

Screenshots or Videos

Image

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

Activity

  1. changed the title [-]No HTTPEvent found in AsyncLocalStorage.[/-] [+]No HTTPEvent found in AsyncLocalStorage[/+] on Jun 12, 2025
  2. julionav commented on Jun 13, 2025

    @julionav

    Same issue here.

  3. elvc commented on Jun 13, 2025

    @elvc
    Author

    @schiller-manuel Should we not upgrade to the devinxi version yet?

  4. ScraperWizard commented on Jun 13, 2025

    @ScraperWizard

    same issue

  5. solace commented on Jun 13, 2025

    @solace

    Workaround in #4409.

  6. wobsoriano commented on Jun 13, 2025

    @wobsoriano
    Contributor

    Hi @elvc! We updated the existing tanstack start clerk quickstart to make sure it works pre-devinxi. Please check the pinned versions on that repo.

    If you want to use devinxi version of tanstack, see #4409 workaround.

    The use of getEvent() on Clerk's side is mainly to read env variables from Cloudflare workers since Nitro attaches it to context. I'm not sure about devinxi if there's a proper way of doing it, but we'll see

  7. GuilhermeAmado commented on Jun 13, 2025

    @GuilhermeAmado

    Same problem here.

  8. GuilhermeAmado commented on Jun 13, 2025

    @GuilhermeAmado

    @wobsoriano the #4409 workaround didn't work for me.
    The server doesn't start.
    I'm stuck here:
    Image

  9. elvc commented on Jun 13, 2025

    @elvc
    Author

    Thanks @wobsoriano @solace the workaround works for me (devinxi version).

    However, I wonder if this is a bigger issue in general. As I mentioned in the description, it happens on Start Basic React Query as well.

  10. elvc commented on Jun 13, 2025

    @elvc
    Author

    Even the most basic example crashed with same error.
    P.S. The version got updated again today in the example but still crashes.

    Image

    Interestingly, Codesandbox doesn't crash for some reason.

  11. wobsoriano commented on Jun 13, 2025

    @wobsoriano
    Contributor

    Even the most basic example crashed with same error.
    P.S. The version got updated again today in the example but still crashes.

    Image

    Interestingly, Codesandbox doesn't crash for some reason.

    This is without Clerk?

  12. elvc commented on Jun 13, 2025

    @elvc
    Author

    Even the most basic example crashed with same error.
    P.S. The version got updated again today in the example but still crashes.
    Image
    Interestingly, Codesandbox doesn't crash for some reason.

    This is without Clerk?

    Yes, correct. That's just the most basic barebone example as you can see in the package.json file.

  13. ian-pascoe commented on Jun 14, 2025

    @ian-pascoe

    Same issue with barebones example

  14. elvc commented on Jun 14, 2025

    @elvc
    Author

    Looks like a widespread issue. Is the team aware of it or able to reproduce as well?
    cc @tannerlinsley

  15. targetlucked69 commented on Jun 14, 2025

    @targetlucked69

    Crazy that they shipped devinxi with all these bugs here and there. But hey, it's beta!

  16. 3 remaining items

  17. wobsoriano commented on Jun 15, 2025

    @wobsoriano
    Contributor

    Hi @elvc! We updated the existing tanstack start clerk quickstart to make sure it works pre-devinxi. Please check the pinned versions on that repo.

    If you want to use devinxi version of tanstack, see #4409 workaround.

    The use of getEvent() on Clerk's side is mainly to read env variables from Cloudflare workers since Nitro attaches it to context. I'm not sure about devinxi if there's a proper way of doing it, but we'll see

    Probably can close this ticket and can continue to track the Clerk's ticket there). I believe it's still an open issue and @wobsoriano / Clerk is still working on it.

    Yup. I opened an issue regarding usage of start function from 3rd party packages here #4409

  18. airtonix commented on Jul 21, 2025

    @airtonix

    It's still actually a bug.

    Image
  19. wobsoriano commented on Jul 21, 2025

    @wobsoriano
    Contributor

    It's still actually a bug.

    Image

    I get this in 1.129.0

  20. airtonix commented on Jul 21, 2025

    @airtonix

    ok looks like 1.129.1 works:

    > npx gitpick tanstack/router/tree/main/examples/react/start-basic
    
    With GitPick clone specific directories or files from GitHub!
    
    ✔ tanstack/router tree:main examples/react/start-basic > start-basic
    ✔ Picked tree from repository in 1.47 seconds.
    
  21. airtonix commented on Jul 22, 2025

    @airtonix

    spoke too soon... it's still a thing

  22. abielzulio commented on Aug 15, 2025

    @abielzulio

    any update?

  23. schiller-manuel commented on Aug 15, 2025

    @schiller-manuel
    Collaborator

    @abielzulio please create a new issue including a complete minimal example if you encounter this or a similar issue

  24. stephen776 commented on Sep 16, 2025

    @stephen776

    I can confirm this is still an issue. I will try to put together a repo if I can

  25. htndev commented on Oct 3, 2025

    @htndev

    I can confirm the issue as well

  26. schiller-manuel commented on Oct 3, 2025

    @schiller-manuel
    Collaborator

    @htndev please provide a complete minimal example and open a new github issue

  27. htndev commented on Oct 3, 2025

    @htndev

    @schiller-manuel Hope this helps. Let me know if you need any help with it

    https://github.com/htndev/tanstack-async-storage-issue

  28. schiller-manuel commented on Oct 3, 2025

    @schiller-manuel
    Collaborator

    @htndev you cannot call a server function from the custom server handler (i.e. inside fetch)

  29. htndev commented on Oct 4, 2025

    @htndev

    Yeah, you're right. I also suspected that it causes the issue. However, it makes me wondering, is it expected though?

  30. schiller-manuel commented on Oct 4, 2025

    @schiller-manuel
    Collaborator

    yes you cannot call a server function before you handed over to start. server entry happens just before

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions