Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The root level IIFE didn't have an array for it's first parameter, aborting... #7

Open
lenin-anzen opened this issue Jul 20, 2017 · 5 comments

Comments

@lenin-anzen
Copy link

@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/eg22rLqE

Any commands you ran prior to debundling:

mkdir debundle-test1 && cd debundle-test1
npm init -y
npm i --save-dev debundle

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

{
  "type": "webpack",
  "entryPoint": 1,
  "knownPaths": {}
}

The EXACT command you ran to debundle.

node ./node_modules/debundle/src/index.js -i ext-bundle.js -o ext-dist/ -c debundle.config.json

Tell me what the issue is:

Error: The root level IIFE didn't have an array for it's first parameter, aborting...
    at webpackDecoder (~\debundle-test1\node_modules\debundle\src\decoders\webpack.js
:19:11)
    at Object.<anonymous> (~\debundle-test1\node_modules\debundle\src\index.js:104:13
)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)

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

@1egoman
Copy link
Owner

1egoman commented Jul 20, 2017

@lenin-anzen Looks like the bundle you're trying to debundle stores it's modules in an unfamiliar place. Using a tool like http://astexplorer.net/, you should be able to figure out where they are located, and specify the path in the configuration file with the property moduleAst.

In addition, I suspect that your entryPoint is wrong, the bundle contains this code which makes me thing that your entrypoint is actually module 0:

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);

@lenin-anzen
Copy link
Author

I found that the one that makes the package is the following project:

With the next notes:

  • Unbuilt sources are built with webpack using the model.xml as the entry file.
  • If there is a 'path' property in the model that will be used as the entry point.

The model.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<catalog>
    <feature>
        <name>ext-bb-login-ng</name>
        <contextItemName>[BBHOST]</contextItemName>
        <properties>
            <property name="version" label="Version" readonly="true" viewHint="text-input,admin,designModeOnly">
                <value type="string">1.0.30</value>
            </property>
            <property name="title" label="Title" readonly="true" viewHint="admin,designModeOnly">
                <value type="string">ext-bb-login-ng</value>
            </property>
            <property name="path" label="Path" readonly="true" viewHint="designModeOnly">
                <value type="string">$(itemRoot)/scripts/ext-bb-login-ng.js</value>
            </property>
            <property name="feature.ui-bb-i18n-ng" label="Feature Ui Bb I 18 N Ng" readonly="true" viewHint="">
                <value type="string">ui-bb-i18n-ng</value>
            </property>
            <property name="feature.vendor-bb-angular-ng-aria" label="Feature Vendor Bb Angular Ng Aria" readonly="true" viewHint="">
                <value type="string">vendor-bb-angular-ng-aria</value>
            </property>
        </properties>
    </feature>
</catalog>

@willvlad
Copy link

willvlad commented Mar 4, 2018

I am having the same issue. Could you please explain where in the astexplorer one finds the AST of a bundle.js file? Not very familiar with the whole AST thing...

@willvlad
Copy link

willvlad commented Mar 4, 2018

Also, wondered if someone knows how to find the correct entrypoint for a webpack bundle??

@nikogu
Copy link

nikogu commented Oct 15, 2018

@willvlad make sure your bundle file only have webpack code, the amdumd mode config need remove. exp: https://github.com/1egoman/debundle/blob/master/test_bundles/webpack/bundle.js

webpack entrypoint is 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants