Git Product home page Git Product logo

Comments (2)

YuzuZensai avatar YuzuZensai commented on June 3, 2024 1

I encountered a similar problem in my project as well. After some messing around, it appears that the issue might be related to NextUI, Because I do have another component library in the project too and that worked fine.

I found a workaround for the issue by patching all instances of router.open in the NextUI. Sending additional href in the parameter to the function call, since I noticed the router interface contains

interface Router {
    isNative: boolean;
    open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void;
    useHref: (href: Href) => string;
}

It seems to resolve the issue for me

I use pnpm to patch all of these occurrence
@nextui-org/use-aria-link

- router.open(e.currentTarget, e);
+ router.open(e.currentTarget, e, e.currentTarget.href);

@nextui-org/use-aria-menu

-      router.open(e.target, e);
+      router.open(e.target, e, e.target.href);

@nextui-org/pagination

-          router.open(e.currentTarget, e);
+          router.open(e.currentTarget, e, e.currentTarget.href);

Then, finally, don't forget to clear your webpack cache or delete your .next folder

This workaround may not be the optimal solution and there's a possibility it could introduce other issues, I haven't looked deep into it, because I need to get my project working in time 😅

EDIT: Seem like there is a PR to fix this now on NextUI repo: nextui-org/nextui#2943

from next.js.

vizsumit avatar vizsumit commented on June 3, 2024 1

@YuzuZensai Thanks for helping me out.

from next.js.

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.