Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm: ERR_MODULE_NOT_FOUND react/jsx-runtime #119

Open
indicozy opened this issue Jun 13, 2022 · 6 comments
Open

pnpm: ERR_MODULE_NOT_FOUND react/jsx-runtime #119

indicozy opened this issue Jun 13, 2022 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@indicozy
Copy link

I use pnpm to solve some npm dependencies bugs but now I cannot import react-daisyui.

Error

  my-project-name git:(dark-mode)  npm run dev

> next-js-boilerplate@1.0.0 dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /home/indicozy/Documents/Projects/oponai/my-project-name/.env
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/indicozy/Documents/Projects/oponai/my-project-name/node_modules/.pnpm/react-daisyui@2.0.3_tgktzqjq2hhcpfjfdazojt3jfa/node_modules/react/jsx-runtime' imported from /home/indicozy/Documents/Projects/oponai/my-project-name/node_modules/.pnpm/react-daisyui@2.0.3_tgktzqjq2hhcpfjfdazojt3jfa/node_modules/react-daisyui/dist/react-daisyui.modern.js
Did you mean to import react@17.0.2/node_modules/react/jsx-runtime.js?
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Stack: NextJS v12.1.6, React v17.0.2, daisyui v2.15.3, react-daisyui v2.0.3

@benjitrosch
Copy link
Collaborator

Hi @indicozy,

I'll be looking into this further, sorry for the delay. I'm not too familiar with pnpm so apologies for not testing whether or not it would work with pnpm.

I'll keep you updated here whenever I find a fix!

@indicozy
Copy link
Author

Hi, @benjitrosch
Gotcha, feel free to tag me if you need more info!

@benjitrosch benjitrosch added the help wanted Extra attention is needed label Jun 21, 2022
@Geczy
Copy link

Geczy commented Jul 21, 2022

im using yarn and have the same issue, any update?

@macklinhrw
Copy link

I'm having the same issue with pnpm

@Klaas058
Copy link
Contributor

Hi @macklinhrw, I do not have the issue with pnpm.

What versions of the following packages are you using?

  • react
  • react-dom
  • react-daisyui
  • @types/react
  • @types/react-dom
  • typescript

As far as I understand the problem, it is a mismatch between typescript, react, react-dom and @types/react.
Lets see if we can figure this out :)

@macklinhrw
Copy link

Thank you,
I was able to fix the issue after updating react.
My React version before the update was: v17 whereas the latest version is v18.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants