Closed imerkle closed 6 years ago
https://github.com/1egoman/debundle/blob/master/DOCS.md#moduleast
You're going to need to put your bundle into a tool like astexplorer.net to figure out where the modules are inside.
Hey @1egoman, thank you for this amazing tool! Commenting on this issue since this is the most recent occurence of this problem.
I just successfully unbundle'd a webpack bundle, and had to use the following moduleAst
:
"moduleAst": ["body", 0, "expression", "argument", "arguments", 0]
This is different than the default configuration (which doesn't have the extra "argument" in it as above).
I'm wondering if this could help explain some of the ast issues? Could webpack be using the configuration above in some circumstances?
Thanks!
@gregsadetsky Yea, potentially. I just went with the defaults that running the command-line webpack
produced, but I have definitely run across bundles that are webpack produced and are different.
Unfortunately, I'm not a webpack expert and don't know why that is, so I made it configurable. Thanks for mentioning it though, someday it'd be neat if there was a way to auto-detect a module list in a bundle so none of this would be an issue. 😄
Hi there,
I'm attempting to debundle this file:
https://github.com/projectestac/wordpress-tinymce-advanced/blob/master/dist/classic-paragraph.js
I'm receiving the following error:
$ debundle -i bundle.js -o dist/ -c debundle.config.json
* Using default AST location for webpack...
* Reading bundle...
/Users/michael/.npm-packages/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/michael/.npm-packages/lib/node_modules/debundle/src/index.js:80:11)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
My config file is:
{
"type": "webpack",
"entryPoint": 0,
"knownPaths": {}
}
Hi there,
I'm attempting to debundle this file:
https://github.com/projectestac/wordpress-tinymce-advanced/blob/master/dist/classic-paragraph.js
I'm receiving the following error:
$ debundle -i bundle.js -o dist/ -c debundle.config.json * Using default AST location for webpack... * Reading bundle... /Users/michael/.npm-packages/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/michael/.npm-packages/lib/node_modules/debundle/src/index.js:80:11) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Function.Module.runMain (internal/modules/cjs/loader.js:754:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
My config file is:
{ "type": "webpack", "entryPoint": 0, "knownPaths": {} }
` $ debundle --input index.js --output dist/ --config config.json
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.
@1egoman,
any updates on this :point_up: ?
Thank you in advance!
@tbaltrushaitis This project is no longer maintained: https://github.com/1egoman/debundle#dragon-here-be-dragons-dragon
Sorry about that.