esxjs / esx

Like JSX, but native and fast
MIT License
652 stars 11 forks source link

Webpack: Critical dependency: the request of a dependency is an expression #12

Closed irudoy closed 4 years ago

irudoy commented 4 years ago

Webpack can't deal with tryToLoad function. As a result – it simply skips requiring a module and ESX has no react in runtime.

WARNING in ./node_modules/esx/index.js 1000:11-24
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (/.../node_modules/webpack/lib/dependencies/ContextDependency.js:40:18)
    at Compilation.reportDependencyErrorsAndWarnings (/.../node_modules/webpack/lib/Compilation.js:1356:24)
    at /.../node_modules/webpack/lib/Compilation.js:1164:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (/.../node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.finish (/.../node_modules/webpack/lib/Compilation.js:1159:28)
    at /.../node_modules/webpack/lib/Compiler.js:622:17
    at _done (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
    at eval (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:128:22)
    at /.../node_modules/webpack/lib/Compilation.js:1091:12
    at /.../node_modules/webpack/lib/Compilation.js:1003:9
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
  @ ./src/apps/app/server.js
  @ multi ./src/apps/app/server.js
davidmarkclements commented 4 years ago

closed by https://github.com/esxjs/esx/commit/01a0c712051b750105f8ca0d2d6be8e6e98960ae

davidmarkclements commented 4 years ago

@irudoy this should work for your case, lmk if it doesn't!

ITOmauricioherran commented 3 years ago

+1