rubenspgcavalcante / webpack-extension-reloader

A upgrade from 🔥webpack-chrome-extension-reloader🔥, now on all browsers
MIT License
494 stars 78 forks source link

Not working with webpack@5.beta #110

Open vjpr opened 4 years ago

vjpr commented 4 years ago

Type:

Environment:

I'm going to open a PR:

Description:

/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack-sources@1.4.3/node_modules/webpack-sources/lib/ConcatSource.js:72
                map.add(item.listMap(options));
                 ^
TypeError: item.listMap is not a function
    at ConcatSource.listMap (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack-sources@1.4.3/node_modules/webpack-sources/lib/ConcatSource.js:72:18)
    at ConcatSource.proto.sourceAndMap (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack-sources@1.4.3/node_modules/webpack-sources/lib/SourceAndMapMixin.js:24:16)
    at getTaskForFile (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/SourceMapDevToolPlugin.js:67:30)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/SourceMapDevToolPlugin.js:240:22
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Cache.js:91:34
    at Array.<anonymous> (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/cache/MemoryCachePlugin.js:45:13)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Cache.js:91:19
    at Hook.eval [as callAsync] (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:19:1)
    at Cache.get (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Cache.js:75:18)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/SourceMapDevToolPlugin.js:198:26
    at arrayEach (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2405:9)
    at Object.each (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2846:9)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/SourceMapDevToolPlugin.js:191:15
    at Hook.eval [as callAsync] (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/Hook.js:18:14)
    at cont (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1913:32)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1956:8
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2830:7
    at Object.each (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2850:39)
    at Compilation.createChunkAssets (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:2693:12)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1951:12
    at Hook.eval [as callAsync] (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1838:36
    at Hook.eval [as callAsync] (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/Hook.js:18:14)
    at Compilation.seal (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1829:27)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compiler.js:930:20
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/Compilation.js:1706:4
    at _next2 (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/tapable@2.0.0-beta.11/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:289:11
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2830:7
    at Object.each (/Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2850:39)
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/webpack@5.0.0-beta.18_webpack@5.0.0-beta.18/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:268:18
    at /Users/Vaughan/dev-mono/thirtyfive/node_modules/.pnpm/neo-async@2.6.1/node_modules/neo-async/async.js:2830:7
vjpr commented 4 years ago

The issue seems to arise when using {devtool: 'inline-cheap-source-map'}. When turning it off it works fine.

Closing - could not reproduce in bare config.

vjpr commented 4 years ago

Was able to reproduce. When using webpack-extension-reloader and {devtool: 'inline-cheap-source-map'}, this error always shows.

vjpr commented 4 years ago

The fix seems to be to simply upgrade to webpack-sources@2.0.0-beta.8. Maybe we could have a separate branch for this.

meatherly commented 4 years ago

@vjpr I was having errors relating to

[webpack-cli] Error: 
    at Object.extractEntries

It broke when I removed the filename option from the output.

  output: {
    path: path.join(__dirname, '/dist'),
    - filename: '[name].js',
  },

The webpack5 migration guide said you can remove that in the clean-up section https://webpack.js.org/migrate/5/#clean-up-configuration 🤷‍♂️

I added it back and everything is working now.

Joozty commented 3 years ago

any update on this? 🙂