webpack-contrib / i18n-webpack-plugin

[DEPRECATED] Embed localization into your bundle
MIT License
317 stars 74 forks source link

TypeError: arguments[i].apply is not a function - issue when trying to run webpack with node js #72

Closed Amitosh1 closed 6 years ago

Amitosh1 commented 6 years ago

webpack version - 3.10.0

getting below error

TypeError: arguments[i].apply is not a function
    at Compiler.apply (C:\git\fork\smarthelpnodeweb\node_modules\tapable\lib\Tapable.js:378:16)
    at webpack (C:\git\fork\smarthelpnodeweb\node_modules\webpack\lib\webpack.js:33:19)
    at module.exports (C:\git\fork\smarthelpnodeweb\tasks\test.js:7:21)
    at handle (C:\git\fork\smarthelpnodeweb\node_modules\worker-farm\lib\child\index.js:44:8)
    at process.<anonymous> (C:\git\fork\smarthelpnodeweb\node_modules\worker-farm\lib\child\index.js:51:3)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

checking the arguments for which it failed

{ options: {},
  localization: null,
  functionName: '__',
  failOnMissing: false,
  hideMessage: false }

plugin config

 plugins: [
      // eslint-disable-next-line global-require
      new I18nPlugin(require('./public/js/localebundle/en_US.json')),
    ],
alexander-akait commented 6 years ago

@Amitosh1 Can you create minimum reproducible test repo?

Amitosh1 commented 6 years ago

feel free to close this issue. i was trying to distribute work with workfarm and found that creating webpack task and passing it as argument to worker was not allowing the proper serialization of plugin option i fixed this by creating config at worker task level and that fixed the issue