question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docz requires a Webpack install

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrstntddcommented, Jun 21, 2018

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

1reaction
pedronauckcommented, Jun 20, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing Webpack Config - Docz
To configure the webpack config we add a gatsby-node.js file at the root of the project and export ... gatsby-node.js const path =...
Read more >
Installation | webpack
This guide goes through the various methods used to install webpack. Prerequisites. Before we begin, make sure you have a fresh version of...
Read more >
Getting Started - webpack
Check out this guide live on StackBlitz. Open in StackBlitz. Basic Setup. First let's create a directory, initialize npm, install webpack ...
Read more >
webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Module Methods - webpack
You do not need to add curly brackets. webpackInclude : A regular expression that will be matched against during import resolution. Only modules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found