Giter Site home page Giter Site logo

Comments (7)

Chetan-B-B avatar Chetan-B-B commented on May 2, 2024 5

This works


const {} = dynamic(import("tw-elements"), { ssr: false });


from tailwind-elements.

hostedposted avatar hostedposted commented on May 2, 2024 1

You need to dynamically load it.
Try something like this:

import dynamic from "next/dynamic"
dynamic(() => import("tw-elements"), { ssr: false })

from tailwind-elements.

Heldeenn avatar Heldeenn commented on May 2, 2024 1

I had this issue and the above solution worked however the element I was using then stopped working?

I am using the accordion example found at the top of this page.

I'm using "require" instead of "import" and it works just fine. I don't understand why though.

import dynamic from "next/dynamic";
dynamic(require("tw-elements"), { ssr: false });

from tailwind-elements.

SirArchibald97 avatar SirArchibald97 commented on May 2, 2024

I had this issue and the above solution worked however the element I was using then stopped working?

I am using the accordion example found at the top of this page.

from tailwind-elements.

hex-grammer avatar hex-grammer commented on May 2, 2024

This works

const {} = dynamic(import("tw-elements"), { ssr: false });

I almost giveup using tw-elements until i got your comment.
Thankyou so muchπŸ€©πŸ‘πŸ»

from tailwind-elements.

Trochonovitz avatar Trochonovitz commented on May 2, 2024

Hi, we just have launched bunch of integration tutorials - both with CSR and SSR frameworks. If you have more questions about integration or you still got some problems with particular components, let us know by adding new issue / topic in discussions section (if there are some unclear informations or just want let us know about something).

Next.js integration tutorial.

from tailwind-elements.

SMSDev1 avatar SMSDev1 commented on May 2, 2024

I still get this error. I've been through the Next.js integration tutorial and its not massively helpful. I don't think the _app.js file is made by default. Even with the above I get "initTE' is not exported from tw-elements. I find that the tw-elements.d.ts file just contains 'declare module "tw-elements' which is a bit odd to me?

Just created a new project to follow the Next.js integration tutorial and I get the same errors
Attempted import error: 'Datepicker' is not exported from 'tw-elements' (imported as 'Datepicker').

@Trochonovitz

from tailwind-elements.

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.