Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

liferay-npm-bundler 1.6.0 fails if dependencies field is not available in package.json #88

Closed
gamerson opened this issue Mar 15, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@gamerson
Copy link
Member

liferay-npm-bundler 1.6.0 assumes that all package.json files have both devDependencies and dependencies defined. If one is missing you get the following error:

src/main/resources/META-INF/resources/js/index.js -> build/resources/main/META-INF/resources/js/index.js
    /private/var/folders/zl/wtp3csp12zz06vwxlqhm_0z00000gn/T/junit7323077713988580432/gradle/foo/node_modules/liferay-npm-bundler/lib/index.js:141
                Object.keys(pkgJson[scope]).forEach(function (depName) {
                       ^

    TypeError: Cannot convert undefined or null to object
        at Function.keys (<anonymous>)
        at /private/var/folders/zl/wtp3csp12zz06vwxlqhm_0z00000gn/T/junit7323077713988580432/gradle/foo/node_modules/liferay-npm-bundler/lib/index.js:141:10
        at Array.forEach (<anonymous>)
        at copyRootPackageJson (/private/var/folders/zl/wtp3csp12zz06vwxlqhm_0z00000gn/T/junit7323077713988580432/gradle/foo/node_modules/liferay-npm-bundler/lib/index.js:140:38)
        at Object.exports.default (/private/var/folders/zl/wtp3csp12zz06vwxlqhm_0z00000gn/T/junit7323077713988580432/gradle/foo/node_modules/liferay-npm-bundler/lib/index.js:25:16)
        at Object.<anonymous> (/private/var/folders/zl/wtp3csp12zz06vwxlqhm_0z00000gn/T/junit7323077713988580432/gradle/foo/node_modules/liferay-npm-bundler/bin/liferay-npm-bundler.js:2:32)
        at Module._compile (module.js:573:30)
        at Object.Module._extensions..js (module.js:584:10)
        at Module.load (module.js:507:32)
        at tryModuleLoad (module.js:470:12)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! foo@1.0.0 build: `babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler`
    npm ERR! Exit status 1
gamerson added a commit to gamerson/liferay-npm-build-tools that referenced this issue Mar 15, 2018
fixes liferay#88

Signed-off-by: Gregory Amerson <gregory.amerson@liferay.com>
@izaera izaera added the bug label Mar 16, 2018
@izaera izaera self-assigned this Mar 16, 2018
@izaera izaera added this to the 1.6.1 milestone Mar 16, 2018
@izaera izaera closed this as completed in ef65be4 Mar 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants