Coder Social home page Coder Social logo

Error importing jsx-runtime about react-plock HOT 6 CLOSED

askides avatar askides commented on July 26, 2024
Error importing jsx-runtime

from react-plock.

Comments (6)

askides avatar askides commented on July 26, 2024 1

Hello Guys.

Please check out the new v3.0.0 version just published. In addition to a number of performance and bundle size improvements, the problem you reported has been fixed.

from react-plock.

askides avatar askides commented on July 26, 2024

Can you please provide your next version?

from react-plock.

philohelp avatar philohelp commented on July 26, 2024

Sure: Next.js v12.0.8

from react-plock.

philohelp avatar philohelp commented on July 26, 2024

To make Plock work fine I use this code with js and no typescript:

import Card from './card'

import dynamic from 'next/dynamic'

const Plock = dynamic(
  import('react-plock').then((mod) => mod.Plock),
  { ssr: false }
)

export default function BodySuppliers({
  hits,
  toggleModal,
  addedClasses = '',
}) {
  const breakpoints = [
    { size: 640, columns: 1 },
    { size: 768, columns: 2 },
    { size: 1024, columns: 3 },
    { size: 1280, columns: 4 },
    { size: 1536, columns: 6 },
  ]
  return (
    <div className={`${addedClasses}`}>
      <Plock nColumns={breakpoints} gap={15}>
        {hits.map((hit) => (
          <div key={hit.objectID} className="max-w-[250px]">
            <Card hit={hit} toggleModal={toggleModal} />
          </div>
        ))}
      </Plock>
    </div>
  )
}

from react-plock.

Ekaji avatar Ekaji commented on July 26, 2024

while running npm run build i got a similar error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/user/Documents/work/myproject/node_modules/react/jsx-runtime' imported from /home/user/Documents/work/myproject/node_modules/react-plock/index.js Did you mean to import react/jsx-runtime.js?
i resolved it by reaching into /node_modules/react-plock/index.js and changing
the first line from
import { jsx } from 'react/jsx-runtime';
to
import { jsx } from 'react/jsx-runtime.js';

ofcourse this might not be an ideal solution.

from react-plock.

philohelp avatar philohelp commented on July 26, 2024

I love this lib ! Thank you

from react-plock.

Related Issues (17)

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.