Docz requires a Webpack install
See original GitHub issueBug 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
- Create a project without Webpack installed
- Install Docz
npm i -D docz
- 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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pedronauck Ahh. Welp, time to hit that big upgrade button. Thank you!
So, you need webpack 4 to run docz, if you use webpack 2.6.1 you won’t be abble to run @chrstntdd