TrySound / rollup-plugin-size-snapshot

Track your library bundles size and its treeshakability with less effort
MIT License
163 stars 12 forks source link

Cannot resolve webpack/buildin/harmony-module.js #24

Closed appsforartists closed 5 years ago

appsforartists commented 5 years ago

I'm getting these crashes in https://github.com/cssinjs/jss/pull/936#discussion_r241926730:

Error: ModuleNotFoundError: Module not found: Error: Can't resolve '.~/Projects/jss/node_modules/webpack/buildin/harmony-module.js' in '/'
    at compiler.run (~/Projects/jss/node_modules/rollup-plugin-size-snapshot/dist/treeshakeWithWebpack.js:58:16)
    at finalCallback (~/Projects/jss/node_modules/webpack/lib/Compiler.js:210:39)
    at hooks.done.callAsync.err (~/Projects/jss/node_modules/webpack/lib/Compiler.js:226:13)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (~/Projects/jss/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (~/Projects/jss/node_modules/tapable/lib/Hook.js:154:20)
    at onCompiled (~/Projects/jss/node_modules/webpack/lib/Compiler.js:224:21)
    at hooks.afterCompile.callAsync.err (~/Projects/jss/node_modules/webpack/lib/Compiler.js:552:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (~/Projects/jss/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (~/Projects/jss/node_modules/tapable/lib/Hook.js:154:20)
    at compilation.seal.err (~/Projects/jss/node_modules/webpack/lib/Compiler.js:549:30)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (~/Projects/jss/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (~/Projects/jss/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeAssets.callAsync.err (~/Projects/jss/node_modules/webpack/lib/Compilation.js:1323:35)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (~/Projects/jss/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (~/Projects/jss/node_modules/tapable/lib/Hook.js:154:20)
    at hooks.optimizeChunkAssets.callAsync.err (~/Projects/jss/node_modules/webpack/lib/Compilation.js:1314:32)
    at _err0 (eval at create (~/Projects/jss/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:11:1)
    at taskRunner.run (~/Projects/jss/node_modules/terser-webpack-plugin/dist/index.js:315:9)
    at step (~/Projects/jss/node_modules/terser-webpack-plugin/dist/TaskRunner.js:76:9)
    at done (~/Projects/jss/node_modules/terser-webpack-plugin/dist/TaskRunner.js:84:30)
    at tryCatcher (~/Projects/jss/node_modules/cacache/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (~/Projects/jss/node_modules/cacache/node_modules/bluebird/js/release/promise.js:512:31)

I've found a similar error in https://github.com/yahoo/fluxible/issues/306, which was related to the version of webpack being used. I tried upgrading to the latest Webpack (4.27.1) and ensuring that this plugin was using the hoisted version, but those didn't resolve the issue.

lilymatcha commented 5 years ago

+1. I'm also running into a similar issue in react-beautiful-dnd.

dkrefta commented 5 years ago

Did anyone solve this problem? (:

dkrefta commented 5 years ago

I used peerDepsExternal from 'rollup-plugin-peer-deps-external' and worked now, I don't know if the same error for you guys.

TrySound commented 5 years ago

I think the problem is fixed in 0.9. Sorry for delay.