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

compilation.getAssets is not a function #62

Open
hideInEye opened this issue Feb 21, 2023 · 2 comments
Open

compilation.getAssets is not a function #62

hideInEye opened this issue Feb 21, 2023 · 2 comments

Comments

@hideInEye
Copy link

webpack : 3.x
babel-loader : 6.2.4
react: 15.x
cmd : webpack --config xxx.js --watch
执行错误,compilation.getAssets is not a function

@lisen6
Copy link

lisen6 commented May 4, 2023

你改下他的源码就行了。compilation.getAssets 是 webpack4 才有的 api。用 compilation.assets 试试

@pavelmickevic
Copy link

pavelmickevic commented Oct 10, 2023

seeing same with "webpack": "^4.12.1"

 98% after emitting WebpackDeadcodePluginC:\git\myApp\node_modules\webpack-deadcode-plugin\src\detect.js:164
        compilation.getAssets().forEach(asset => {
                    ^

TypeError: compilation.getAssets is not a function
    at getWebpackAssets (C:\git\myApp\node_modules\webpack-deadcode-plugin\src\detect.js:164:14)
    at detectDeadCode (C:\git\myApp\node_modules\webpack-deadcode-plugin\src\detect.js:9:17)
    at WebpackDeadcodePlugin.handleAfterEmit (C:\git\myApp\node_modules\webpack-deadcode-plugin\src\index.js:32:3)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\git\myApp\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:14:1)
    at AsyncSeriesHook.lazyCompileHook (C:\git\myApp\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at C:\git\myApp\node_modules\webpack\lib\Compiler.js:432:27
    at C:\git\myApp\node_modules\neo-async\async.js:2813:7
    at done (C:\git\myApp\node_modules\neo-async\async.js:3521:9)
    at MemoryFileSystem.writeFile (C:\git\myApp\node_modules\memory-fs\lib\MemoryFileSystem.js:328:9)
    at writeOut (C:\git\myApp\node_modules\webpack\lib\Compiler.js:415:30)
    at Immediate.<anonymous> (C:\git\myApp\node_modules\memory-fs\lib\MemoryFileSystem.js:288:4)
    at processImmediate (internal/timers.js:464:21)

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