1egoman / debundle

:card_file_box: A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.
https://www.npmjs.com/package/debundle
705 stars 145 forks source link

Error: Locating the module AST failed. #8

Closed jspenc72 closed 7 years ago

jspenc72 commented 7 years ago

@1egoman

In order to troubleshoot, I need:

A bundle that doesn't work, preferably as minimal as possible. Upload it to pastebin.com:

Link: https://pastebin.com/TEbhjypb Any commands you ran prior to debundling:

debundle -i tmp/js/commons-bundle.184afa95.js -o ./debundle -c ./debundle.config.json 

Your configuration that you passed with the -c argument when debundling.

{
  "type": "webpack",
  "entryPoint": 0,
  "moduleAst": 
  "knownPaths": {
    "0": "./cities"
  }
}

The EXACT command you ran to debundle.

debundle -i tmp/js/commons-bundle.184afa95.js -o ./debundle -c ./debundle.config.json

Tell me what the issue is: Getting an error

$ debundle -i tmp/js/commons-bundle.184afa95.js -o ./debundle -c ./debundle.config.json 
* Using default AST location for webpack...
* Reading bundle...
/Users/jessespencer/.nvm/versions/node/v8.1.2/lib/node_modules/debundle/src/index.js:80
    throw new Error(`Locating the module AST failed. Please specifify a valid manual ast path in your config file with the key \`moduleAst\`. We got as far as ${moduleAstPathTriedSoFar.join('.')} before an error occured.`);
    ^

Error: Locating the module AST failed. Please specifify a valid manual ast path in your config file with the key `moduleAst`. We got as far as body.0.expression.arguments before an error occured.
    at Object.<anonymous> (/Users/jessespencer/.nvm/versions/node/v8.1.2/lib/node_modules/debundle/src/index.js:80:11)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

If you omit any of these parts, I can't help you!

jspenc72 commented 7 years ago

Figured it out. Thanks anyway.

imerkle commented 6 years ago

@jspenc72 how did you figure it out ? getting same error

gardinermichael commented 4 years ago

Same here

particle6 commented 4 years ago

Figured it out. Thanks anyway.

@jspenc72 How did you figure this out?

partiid commented 1 year ago

Any updates? How did you figure that out?