javascript-obfuscator / rollup-plugin-javascript-obfuscator

Rollup plugin for javascript-obfuscator
51 stars 17 forks source link

Included as stated in readme but I get TypeError: cannot read proprty length of undefined #2

Open SumNeuron opened 6 years ago

SumNeuron commented 6 years ago

Tried to include this in the tutorial from https://code.lengstorf.com/learn-rollup-js/ and got TypeError...

sgnagnarella commented 5 years ago

I am getting a similar error when turning on source maps. This is my rollup.js file

` import commonjs from "rollup-plugin-commonjs"; import obfuscatorPlugin from "rollup-plugin-javascript-obfuscator";

export default { input: "src/main.js", output: { file: "build/main.js", format: "cjs", name: "fwi" }, sourceMap: true, sourceMapMode: "inline", plugins: [ commonjs({ include: "node_modules/**" }), obfuscatorPlugin({ compact: true }) ] }; `

And this is the error I get:

[!] TypeError: Cannot read property 'length' of undefined TypeError: Cannot read property 'length' of undefined at Link.traceMappings (/Users/sgnagnarella/Documents/SourceCode/pcshim/node_modules/rollup/dist/rollup.js:13559:54) at collapseSourcemaps (/Users/sgnagnarella/Documents/SourceCode/pcshim/node_modules/rollup/dist/rollup.js:13680:21) at /Users/sgnagnarella/Documents/SourceCode/pcshim/node_modules/rollup/dist/rollup.js:14946:27 at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:744:11) at startup (internal/bootstrap/node.js:285:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)