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

Fix nextjs example #10439

Closed
1 task done
pvtri96 opened this issue Feb 25, 2018 · 2 comments
Closed
1 task done

Fix nextjs example #10439

pvtri96 opened this issue Feb 25, 2018 · 2 comments
Labels
docs Improvements or additions to the documentation

Comments

@pvtri96
Copy link

pvtri96 commented Feb 25, 2018

Can not start nextjs example server.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The project start normally after running npm run dev (for development) or npm run build (for production)

Current Behavior

Log after running npm run dev

> [email protected] dev C:\Users\Tony\Desktop\material-ui\examples\nextjs
> next

Error: Cannot find module 'webpack'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\Tony\Desktop\material-ui\next.config.js:1:17)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Tony\AppData\Roaming\npm-cache\_logs\2018-02-25T03_13_50_893Z-debug.log

Log after npm run build

> [email protected] build C:\Users\Tony\Desktop\material-ui\examples\nextjs
> next build

{ Error: Cannot find module 'webpack'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\Tony\Desktop\material-ui\next.config.js:1:79)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at loadConfig (C:\Users\Tony\Desktop\material-ui\examples\nextjs\node_modules\next\dist\server\c
onfig.js:59:28)
    at getConfig (C:\Users\Tony\Desktop\material-ui\examples\nextjs\node_modules\next\dist\server\co
nfig.js:42:20)
    at _callee$ (C:\Users\Tony\Desktop\material-ui\examples\nextjs\node_modules\next\dist\server\bui
ld\index.js:118:43)
    at tryCatch (C:\Users\Tony\Desktop\material-ui\examples\nextjs\node_modules\regenerator-runtime\
runtime.js:62:40) code: 'MODULE_NOT_FOUND' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Tony\AppData\Roaming\npm-cache\_logs\2018-02-25T03_14_52_473Z-debug.log

Steps to Reproduce (for bugs)

  1. Firstly, cd examples/nextjs && npm install
  2. Then, npm run dev or npm run build to see the bugs in the console.

Context

I am trying to integrate Material-UI with NextJS server for Universal Ap. After clone the example, I can not start running the project as expected.

My Environment

Tech Version
Material-UI 1.0.0-beta.34
React 16.2.0
React DOM 16.2.0
jss 9.8.0
react-jss 8.3.3
node 8.9.4
npm 5.6.0
OS windows 10
@oliviertassinari
Copy link
Member

@pvtri96 I'm sorry, I can't reproduce the issue. webpack is a dependency of Next.js. Something is wrong on their side of npm side.

@lorensr
Copy link
Contributor

lorensr commented Aug 17, 2018

@pvtri96 did you ever solve? I'm seeing the same issue.

Also, matching issues:

vercel/next.js#4781
#11309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants