javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
870 stars 82 forks source link

HEAPU32 is not defined #92

Closed telubato closed 4 years ago

telubato commented 4 years ago

Hi,

After add lib @react-pdf/renderer on my project, my project can't be load, appears a error message:

"VM186:1 Uncaught ReferenceError: HEAPU32 is not defined at Function.eval [as bind_value] (eval at _0x3ee8ff (bundle.js?version=prod:98), :1:27)

Any idea? Thank you.

sanex3339 commented 4 years ago

I may suggest that this is related with web worker and similar to https://github.com/javascript-obfuscator/webpack-obfuscator/issues/85 issue.

Without more details i can't help.

telubato commented 4 years ago

Hi,

After split the code from node-modules, and not ofuscated modules, issue was solved. I think that problem was related with size of bundle. Thank you.

djaffer commented 2 years ago

I am facing this same issue. image

tult-rk commented 2 years ago

@djaffer I have the same issue today. Are you use nextjs 12 with swc for transpileing code. If yes, you could try to set swcMinify: false in next.config.js. It works for me

djaffer commented 2 years ago

I am using react. I got it to work by separating out node modules. The documentation can have these configs as this is such a common issue. The documentation needs improvement.

Credit to @mauricedoepke #50

config.optimization.splitChunks = {
      cacheGroups: {
        vendor: {
          test: /node_modules/,
          chunks: 'initial',
          name: 'vendor',
          enforce: true,
        },
      },

    new WebpackObfuscator(
        {
          rotateStringArray: true,
        },
        ['**/vendor.*.chunk.js']
      )
    );
lakindu2002 commented 2 years ago

@djaffer I have the same issue today. Are you use nextjs 12 with swc for transpileing code. If yes, you could try to set swcMinify: false in next.config.js. It works for me

This worked like a charm!

erlangparasu commented 1 year ago

@telubato @djaffer which file need to be editted?

djaffer commented 1 year ago

webpack, config.js