Git Product home page Git Product logo

Comments (9)

tvpavan avatar tvpavan commented on May 28, 2024 1

+1

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on May 28, 2024

Can you upload minimal working project where i can reproduce this error? It should be prepared project, i should just install dependencies and build it.

from webpack-obfuscator.

Nantris avatar Nantris commented on May 28, 2024

@sanex3339 I can't upload my source code, and I can't even begin to determine how to track down the source of the error, hence reproduce the issue.

If you could give me any advice at all on how to track down the source of the error I'd be happy to provide a repo to reproduce the issue.

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on May 28, 2024

You can replace your source code on any other code on which i can reproduce this error

from webpack-obfuscator.

Nantris avatar Nantris commented on May 28, 2024

@sanex3339 I haven't the slightest clue where the error originates, hence cannot reproduce or debug on my own. I have tried to reproduce the issue with a number of best guesses at what the issue could be, without any luck.

Do you have any idea how I can track this down when it's not giving me a source for the errors? If I can find the error, I'd be happy to produce a package to demonstrate. Thanks for any advice.

from webpack-obfuscator.

Nantris avatar Nantris commented on May 28, 2024

@sanex3339 so I finally revisited this. I manually obfuscated the output javascript using https://github.com/javascript-obfuscator/javascript-obfuscator and it worked without any issues. Do you have any idea how I can prevent the webpack version from relying on sourcemaps? The underlying tool seems to work fine without.

Thanks for any advice you might be able to give.

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on May 28, 2024

Hi. Interesting. I'm not good at webpack plugins, so i need some help with source maps

from webpack-obfuscator.

nanki avatar nanki commented on May 28, 2024

in my case.

package.json

{
  "name": "ab",
  "version": "1.0.0",
  "scripts": {
    "start": "webpack --config config.js --entry ./ab.js --output-filename output.js"
  },
  "devDependencies": {
    "babel-loader": "^7.1.4",
    "webpack": "^4.1.1",
    "webpack-cli": "^2.0.11",
    "webpack-obfuscator": "^0.14.3"
  }
}

config.js

const JavaScriptObfuscator = require('webpack-obfuscator')

module.exports = {
  plugins: [
    new JavaScriptObfuscator({sourceMap: true})
  ],
  module: {
    rules: [{test: /\.js$/, use: 'babel-loader'}]
  }
}

ab.js

var b = 'b';
var ab = 'a\
' + b;

console.log(ab);
$ npm start
> [email protected] start /Users/nanki/ab
> webpack --config config.js --entry ./ab.js --output-filename output.js

(node:95447) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-map-generator.js:275
        throw new Error('Invalid mapping: ' + JSON.stringify({
              ^
Error: Invalid mapping: {"generated":{"line":1,"column":1617},"source":"sourceMap","original":{"line":81,"column":-4},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-map-generator.js:275:15)
    at SourceMapGenerator_addMapping [as addMapping] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-map-generator.js:105:14)
    at /Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:350:15
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:229:11)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_walk [as walk] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:225:15)
    at SourceNode_toStringWithSourceMap [as toStringWithSourceMap] (/Users/nanki/ab/node_modules/escodegen-wallaby/node_modules/source-map/lib/source-map/source-node.js:341:10)
    at Object.generate (/Users/nanki/ab/node_modules/escodegen-wallaby/escodegen.js:2782:23)
    at e.value (/Users/nanki/ab/node_modules/javascript-obfuscator/dist/index.js:24:267520)
    at e.value (/Users/nanki/ab/node_modules/javascript-obfuscator/dist/index.js:24:266445)
    at Function.value (/Users/nanki/ab/node_modules/javascript-obfuscator/dist/index.js:24:28815)
    at /Users/nanki/ab/node_modules/webpack-obfuscator/index.js:49:66
    at Array.forEach (<anonymous>)
    at /Users/nanki/ab/node_modules/webpack-obfuscator/index.js:27:23
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nanki/ab/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/nanki/ab/node_modules/tapable/lib/Hook.js:35:21)
    at hooks.additionalAssets.callAsync.err (/Users/nanki/ab/node_modules/webpack/lib/Compilation.js:943:36)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nanki/ab/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/nanki/ab/node_modules/tapable/lib/Hook.js:35:21)
    at hooks.optimizeTree.callAsync.err (/Users/nanki/ab/node_modules/webpack/lib/Compilation.js:939:32)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nanki/ab/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/nanki/ab/node_modules/tapable/lib/Hook.js:35:21)
    at Compilation.seal (/Users/nanki/ab/node_modules/webpack/lib/Compilation.js:881:27)
    at hooks.make.callAsync.err (/Users/nanki/ab/node_modules/webpack/lib/Compiler.js:464:17)
    at _err0 (eval at create (/Users/nanki/ab/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)
    at _addModuleChain (/Users/nanki/ab/node_modules/webpack/lib/Compilation.js:749:12)
    at processModuleDependencies.err (/Users/nanki/ab/node_modules/webpack/lib/Compilation.js:688:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `webpack --config config.js --entry ./ab.js --output-filename output.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nanki/.npm/_logs/2018-03-13T09_51_55_512Z-debug.log

from webpack-obfuscator.

sanex3339 avatar sanex3339 commented on May 28, 2024

Closed as old. Please try on latest version.

from webpack-obfuscator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.