Optimizing --> Invalid assignment error


#1

Struggling with the next error:

Plugin installation was unsuccessful due to error "Command failed: /usr/share/kibana/node/bin/node /usr/share/kibana/src/cli --env.name=production --optimize.useBundleCache=false --server.autoListen=false --plugins.initialize=false --uiSettings.enabled=false
(node:3102) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
FATAL { Error: Optimizations failure.
   6356 modules

    ERROR in wazuh.bundle.js from UglifyJs
    Invalid assignment [wazuh.bundle.js:62094,30]

    at FsOptimizer.failedStatsToError (/usr/share/kibana/src/optimize/base_optimizer.js:245:27)
    at compiler.run (/usr/share/kibana/src/optimize/fs_optimizer.js:28:26)
    at onCompiled (/usr/share/kibana/node_modules/webpack/lib/Compiler.js:241:12)
    at applyPluginsAsync.err (/usr/share/kibana/node_modules/webpack/lib/Compiler.js:514:14)
    at next (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:202:11)
    at Compiler.<anonymous> (/usr/share/kibana/node_modules/webpack/lib/CachePlugin.js:78:5)
    at Compiler.applyPluginsAsyncSeries (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:206:13)
    at compilation.seal.err (/usr/share/kibana/node_modules/webpack/lib/Compiler.js:511:11)
    at Compilation.applyPluginsAsyncSeries (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:195:46)
    at self.applyPluginsAsync.err (/usr/share/kibana/node_modules/webpack/lib/Compilation.js:671:19)
    at Compilation.applyPluginsAsyncSeries (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:195:46)
    at self.applyPluginsAsync.err (/usr/share/kibana/node_modules/webpack/lib/Compilation.js:662:11)
    at next (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:202:11)
    at Compilation.<anonymous> (/usr/share/kibana/node_modules/uglifyjs-webpack-plugin/dist/index.js:244:6)
    at next (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:204:14)
    at Compilation.compilation.plugin (/usr/share/kibana/node_modules/webpack/lib/BannerPlugin.js:67:5)
    at Compilation.applyPluginsAsyncSeries (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:206:13)
    at self.applyPluginsAsync.err (/usr/share/kibana/node_modules/webpack/lib/Compilation.js:657:10)
    at next (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:202:11)
    at Compilation.<anonymous> (/usr/share/kibana/node_modules/extract-text-webpack-plugin/dist/index.js:275:11)
    at Compilation.applyPluginsAsyncSeries (/usr/share/kibana/node_modules/tapable/lib/Tapable.js:206:13)
    at sealPart2 (/usr/share/kibana/node_modules/webpack/lib/Compilation.js:653:9)

My plugin runs perfect when using ./bin/kibana --devthe problem occurs once the production optimizing starts... Help us please!

Thanks in advance,
Jesús


#2

Hi @jesusgn90,

Is there any chance we can take a look at your plugin source (will be easier to debug if we can reproduce it locally). If not, we'll just try to guess :slight_smile:

Best,
Oleg


(Javier Castro) #3

Hi @azasypkin, sure, this is our code: https://github.com/wazuh/wazuh-kibana-app/tree/3.3

Regards.


#4

So I debugged this a bit and it looks like the issue is in the query-string package that's getting included into client side bundle in non-transpiled form (e.g. it uses arrow functions) and Webpack UglifyJS plugin can't digest that.

Can you comment that out and see whether problem goes away, just to see if it's the right direction?


(Javier Castro) #5

Hi, I just reached the same conclusion.

I'm going to comment that code out and see what happens.

Regards.


(Javier Castro) #6

Yep, that was the problem.

Thanks for your assistance.

Regards.


#7

Well, we solved it, finally we need just to use a proper version from query-string which is transpiled and ready to use. Any case thanks in advance to the Elastic support, thanks to you we have learned useful tips today and have a better knowledge about your optimization procedure.

By our side this thread is solved and closed, thanks in advance.

Best regards,
Jesús


(system) #8

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.