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

Cannot find module '/app/node_modules/react-icons/lib'. Please verify that the package.json has a valid "main" entry #248

Closed
vallerion opened this issue Aug 18, 2019 · 3 comments

Comments

@vallerion
Copy link

vallerion commented Aug 18, 2019

Describe the problems
hi guys, i use react + next.js@9.0.2, react-icons@3.7.0, after update next 7 -> 9 version i got error while build:
Error: Cannot find module '/app/node_modules/react-icons/lib'. Please verify that the package.json has a valid "main" entry at tryPackage (internal/modules/cjs/loader.js:228:19) at Function.Module._findPath (internal/modules/cjs/loader.js:365:18) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:612:27) at Function.Module._load (internal/modules/cjs/loader.js:527:27) at Module.require (internal/modules/cjs/loader.js:683:19) at require (internal/modules/cjs/helpers.js:16:16) at Object.react-icons (/app/.next/server/static/development/pages/question/public.js:7954:18) at __webpack_require__ (/app/.next/server/static/development/pages/question/public.js:23:31) at Module../components/header/navbar/Toggler.js (/app/.next/server/static/development/pages/question/public.js:3188:69) at __webpack_require__ (/app/.next/server/static/development/pages/question/public.js:23:31) at Module../components/header/Header.js (/app/.next/server/static/development/pages/question/public.js:2766:73) at __webpack_require__ (/app/.next/server/static/development/pages/question/public.js:23:31) at Module../components/header/HeaderContainer.js (/app/.next/server/static/development/pages/question/public.js:2831:65) at __webpack_require__ (/app/.next/server/static/development/pages/question/public.js:23:31) at Module../components/layout/SitePage.js (/app/.next/server/static/development/pages/question/public.js:3822:82) at __webpack_require__ (/app/.next/server/static/development/pages/question/public.js:23:31) { code: 'MODULE_NOT_FOUND', path: '/app/node_modules/react-icons/package.json', requestPath: 'react-icons'

my code using react-icons:

import {
  FaFacebookF, FaLinkedinIn, FaTelegramPlane, FaVk
} from 'react-icons/fa'

...

              <a href="#">
                <FaVk />
              </a>
...
@novonimo
Copy link

novonimo commented Sep 2, 2019

Make sure you are importing correct icon name from "react-icon"

It looks like you imported correct icons in this code snippet but checks your all importing expression.

@flexlee
Copy link

flexlee commented Oct 12, 2019

I'm having same problem with SSR on nextjs. It's the <IconContect.Provider>. Same as #235

@kamijin-fanta
Copy link
Member

resolved in #273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants