aackerman / circular-dependency-plugin

Detect circular dependencies in modules compiled with Webpack
https://www.npmjs.com/package/circular-dependency-plugin
ISC License
921 stars 47 forks source link

Version 5 doesn't work with webpack 4 (while 4+ works quite well) #34

Closed ulfryk closed 6 years ago

ulfryk commented 6 years ago
TypeError: Cannot read property 'tap' of undefined
    at CircularDependencyPlugin.apply (/home/js/Projects/samwise/search-ql/node_modules/circular-dependency-plugin/index.js:20:32)
    at plugins.forEach.plugin (/home/js/Projects/samwise/search-ql/node_modules/enhanced-resolve/lib/ResolverFactory.js:276:10)
    at Array.forEach (<anonymous>)
    at Object.exports.createResolver (/home/js/Projects/samwise/search-ql/node_modules/enhanced-resolve/lib/ResolverFactory.js:275:10)
    at ResolverFactory._create (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/ResolverFactory.js:60:28)
    at ResolverFactory.get (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/ResolverFactory.js:53:28)
    at NormalModuleFactory.getResolver (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/NormalModuleFactory.js:474:31)
    at /home/js/Projects/samwise/search-ql/node_modules/webpack/lib/NormalModuleFactory.js:163:32
    at /home/js/Projects/samwise/search-ql/node_modules/webpack/lib/NormalModuleFactory.js:117:4
    at hooks.beforeResolve.callAsync (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/NormalModuleFactory.js:357:5)
    at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (/home/js/Projects/samwise/search-ql/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)
    at AsyncSeriesWaterfallHook.lazyCompileHook [as _callAsync] (/home/js/Projects/samwise/search-ql/node_modules/tapable/lib/Hook.js:35:21)
    at NormalModuleFactory.create (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/NormalModuleFactory.js:338:28)
    at semaphore.acquire (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/Compilation.js:649:18)
    at Semaphore.acquire (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/util/Semaphore.js:16:4)
    at Compilation._addModuleChain (/home/js/Projects/samwise/search-ql/node_modules/webpack/lib/Compilation.js:648:18)

from config:


    plugins: [
      new CircularDependencyPlugin({ exclude: /node_modules/, failOnError: true }),
    ],
aackerman commented 6 years ago

I've released 5.0.1 that sets the peer dependency to 4.0.1 or greater for webpack.

elmeerr commented 6 years ago

is it possible that I'm facing the same error?

Creating an optimized production build...
Failed to compile.

Cannot read property 'tap' of undefined

error An unexpected error occurred: "Command failed.
Exit code: 1
Command: C:\\WINDOWS\\system32\\cmd.exe
Arguments: /d /s /c node scripts/build.js
Directory: C:\\Users\\dantase\\Documents\\frontend-brix-businesscontacts
Output:
".

webpack 4.8.3 cdp: latest

Kind regards

Yangfan2016 commented 3 years ago

+1 "circular-dependency-plugin": "^5.2.2", "webpack": "^4.44.1",