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

Docz requires a Webpack install #56

Closed
oliverjam opened this issue Jun 18, 2018 · 6 comments
Closed

Docz requires a Webpack install #56

oliverjam opened this issue Jun 18, 2018 · 6 comments

Comments

@oliverjam
Copy link

oliverjam commented Jun 18, 2018

Bug Report

We didn't have Webpack installed, so Docz threw an error when running docz dev:

Error: Cannot find module 'webpack/schemas/WebpackOptions.json'

npm i -D webpack fixed the error immediately.

To Reproduce

  1. Create a project without Webpack installed
  2. Install Docz npm i -D docz
  3. Run npx docz dev
❯ npm run docz:dev

> test@ docz:dev /Users/oliver.phillips/Code/mosaic-project/mosaic
> docz dev

module.js:549
    throw err;
    ^

Error: Cannot find module 'webpack/schemas/WebpackOptions.json'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/oliver.phillips/Code/mosaic-project/mosaic/node_modules/@webpack-contrib/config-loader/lib/index.js:4:23)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/oliver.phillips/Code/mosaic-project/mosaic/node_modules/webpack-serve/lib/config.js:3:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
npm ERR! code ELIFECYCLE

Expected behavior

Docz should either have Webpack as a dependency or at least warn that a peerDependency is missing.

Environment

  • OS: macOS 10.13.5
  • Node/npm version: Node v8.11.1/npm v6.0.1
@pedronauck
Copy link
Member

Sorry, but I started a new folder here with just docz as dependency, then ran: npx docz dev e didn't happen any error. Can you give some information about your project?

@oliverjam
Copy link
Author

Hmm you're right, I just tried that and it worked fine. We were also using Babel 6 so it's possible that was the real underlying cause, sorry!

@pedronauck
Copy link
Member

If you want to use babel 6 you can use docz-plugin-babel6 👍

@chrstntdd
Copy link

chrstntdd commented Jun 20, 2018

Encountering this exact same issue. Re-cloned my project, installed fresh dependencies, and then installed docz with npm i -D docz. Running docz dev caused the same error message as the OP 😢

Project is already running on webpack 2.6.1 and babel 7.

@pedronauck
Copy link
Member

So, you need webpack 4 to run docz, if you use webpack 2.6.1 you won't be abble to run @chrstntdd

@chrstntdd
Copy link

@pedronauck Ahh. Welp, time to hit that big upgrade button. Thank you!

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

3 participants