question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Wouter compat

See original GitHub issue

Describe the bug Wouter errors when integrated into a Million/React environment

To Reproduce

import { createRoot, useState } from 'million/react';
import { Link, Route } from 'wouter';

function App() {
  const [count, setCount] = useState(0);
  return (
    <div>
      <button onClick={() => setCount(count + 1)}>{count}</button>

      <Link href="/users/1">
        <a className="link">Profile</a>
      </Link>

      <Route path="/about">About Us</Route>
      <Route path="/users/:name">{(params) => <div>Hello, {params.name}!</div>}</Route>
    </div>
  );
}

createRoot(document.body).render(<App />);

Gives something like this:

wouter.js?v=b667f2ca:1129 Uncaught TypeError: Cannot read properties of null (reading 'i')
    at useRef (wouter.js?v=b667f2ca:1129:14)
    at useNavigate (wouter.js?v=b667f2ca:1636:18)
    at Link (wouter.js?v=b667f2ca:1659:18)
    at compat.ts:15:17
    at hook2 (hooks.ts:37:17)
    at Object.createComponent [as handleFunction] (compat.ts:39:4)
    at Object.h (h.ts:45:14)
    at App (script.tsx:15:19)
    at compat.ts:15:17
    at hook2 (hooks.ts:37:17)

Expected behavior

Should behave as Wouter intends it to

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
cbbfcdcommented, Jun 29, 2022

i found this pr, I should dig deeper into the problem and now i probably understand the reason

2reactions
QuiiBzcommented, Aug 18, 2022

Reopening this issue since #258 doesn’t completely fix the bugs - but fixes some of them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · aidenybai/million - GitHub
bug: benchmarks become skewed with vnode adapters bug Something isn't working. #232 opened on Aug 1 by aidenybai · @aidenybai · bug: Wouter...
Read more >
Wouter - Medium
Read writing from Wouter on Medium. Proud owner of wouterplanet.com. Every day, Wouter and thousands of other voices read, write, and share important ......
Read more >
Show StackBlitz Examples
Browse StackBlitz projects using wouter, crack open the code and start editing in your ... Run Million Wouter Compat Demo created by Cbbfcd...
Read more >
Bug #1892438 “django 2 compatibility” - Launchpad Bugs
The django adminaudit module is currently not compatible with django 2, this will need to be ... Bug #1892438 reported by Wouter van...
Read more >
AVR C Runtime Library - Bugs: bug #24887, boot.h not compatible ...
Wouter <wutje>. Thu 20 Nov 2008 07:41:53 AM UTC, original submission: The case where I am seeing this is in the definitions of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found