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 'webpack/lib/RuleSet' #1427

Closed
luoway opened this issue Nov 13, 2018 · 17 comments
Closed

Cannot find module 'webpack/lib/RuleSet' #1427

luoway opened this issue Nov 13, 2018 · 17 comments

Comments

@luoway
Copy link

luoway commented Nov 13, 2018

Version

15.4.0

Reproduction link

https://www.npmjs.com/package/vue-loader/v/15.4.2

Steps to reproduce

Init a project without installing webpack locally , and run global webpack in terminal

What is expected?

webpack build successfully

What is actually happening?

Error: Cannot find module 'webpack/lib/RuleSet'


Due to line 2 in node_modules/vue-loader/lib/plugin.js

const RuleSet = require('webpack/lib/RuleSet')
@bishoywagih
Copy link

i have the same error, however const RuleSet = require('webpack/lib/RuleSet') is exists in plugin.js file

@allenchannn
Copy link

any ways to solve?

@haoqunjiang
Copy link
Member

@935839596 webpack already added as a peer dependency in the latest version. Now there should be a warning if you didn’t manually install webpack alongside vue-loader.

@gopala000
Copy link

I had to add the following to webpack.config.js to get around this error:

var webpack = require('webpack');

@BoyaZhang
Copy link

add webpack package to ur package.json, cause vue-loader is based on it

@ooxiongoo
Copy link

Any updates?

@onexdata
Copy link

I'm also having this problem, none of the above suggestions work

@bietkul
Copy link

bietkul commented Sep 20, 2019

Check this #1586 (comment)
Adding webpack as a dev dependency resolved the issue for me.

@matthew-dean
Copy link

This happens with the next version of Webpack (Webpack 5.0.0-rc.1)

@helloscoopa
Copy link

helloscoopa commented Oct 20, 2020

Check this #1586 (comment)
Adding webpack as a dev dependency resolved the issue for me.

tried doing this, still no luck.
Require stack:
image

*btw, I'm using nuxt and trying to configure nuxt-highcharts

@hieutranminh
Copy link

Check this #1586 (comment)
Adding webpack as a dev dependency resolved the issue for me.

tried doing this, still no luck.
Require stack:
image

*btw, I'm using nuxt and trying to configure nuxt-highcharts

I have the same problem, any ways to solve? :(

@Cobertos
Copy link

It has to be webpack ^4.0.0 as the file was removed in v5.

webpack/webpack@74d4669#diff-f953e9f47b1aa87d20fc094ba839f3b5c5e145cf963ba0c151185bd3f344cdd3

@entinio
Copy link

entinio commented Oct 22, 2020

It has to be webpack ^4.0.0 as the file was removed in v5.

"has to"... well, if we have packages that depends on webpack5, we can't really ask them to use a downgraded version though

@haoqunjiang
Copy link
Member

Both v15 & v16 have already added support for webpack 5. So if you still encounter this issue, please open a new issue with a minimal reproduction.

@OlenDavis
Copy link

FYI, this was the only relevant search result when I also encountered the error you mentioned @hieutranminh in a Nuxt project. So in case anyone else out there is also trying to use Webpack 5 with Nuxt, it's a matter of @nuxt/components not yet supporting webpack5, and we can move that discussion over there: nuxt/components#105

@Cobertos
Copy link

Oh yes, sorry, I only added my comment to help those getting dropped off from search engines.

@BarrySong97
Copy link

Check this #1586 (comment)
Adding webpack as a dev dependency resolved the issue for me.

this solved my problem

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