Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading '__H') #1726

@jasonhilldm

Description

@jasonhilldm

Describe the bug
I have used preact-cli to create a new TypeScript project and have made zero changes to the code. I then run preact build --no-prerender to generate the production files.

When I hit the index.html in a browser the home page loads fine but when I click the "Me" nav link, I get the error "Uncaught TypeError: Cannot read properties of undefined (reading '__H')". If I click the "John" link, that route loads fine and then clicking on the "Me" link again also loads fine the second time.

If I refresh the browser on any route other than the home page, I also get the same error.

To Reproduce

  1. Run npx preact-cli create typescript test
  2. Run preact build --no-prerender
  3. Browse the index.html of the production build
  4. Navigate to the Me link in the nav (error occurs).
  5. Naviugate to the Jonn link in the nav (no error).
  6. Refresh the John link in the nav (error occurs).

I'm assuming this must be something specific in my environment but I'm not sure how to figure out what is causing this problem, so any pointers are greatly appreciated.

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