Skip to content

Add CircleCI. Closes GH-31 - #32

Merged
deathcap merged 12 commits into
masterfrom
circleci
Feb 8, 2016
Merged

Add CircleCI. Closes GH-31#32
deathcap merged 12 commits into
masterfrom
circleci

Conversation

@deathcap

@deathcap deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member

#31

@deathcap

deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member Author

Getting this mysterious error from browserify on CircleCI - never seen this locally..

./app/node_modules/.bin/browserify app/app.js > app/wsmc/src/main/resources/www/bundle.js
Error: Cannot find module 'app/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js' from '/home/ubuntu/voxel-clientmc'
  at /home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
  at process (/home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
  at ondir (/home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
  at load (/home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
  at onex (/home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
  at /home/ubuntu/voxel-clientmc/app/node_modules/browserify/node_modules/resolve/lib/async.js:22:47

./app/node_modules/.bin/browserify app/app.js > app/wsmc/src/main/resources/www/bundle.js returned exit code 1

at FSReqWrap.oncomplete (fs.js:82:15) Action failed: ./app/node_modules/.bin/browserify app/app.js > app/wsmc/src/main/resources/www/bundle.js

@deathcap

deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member Author

http://stackoverflow.com/questions/21685044/browserify-uncaught-error-cannot-find-module-in-bundle-js says this occurs when using a jison parser, sure enough https://github.com/rom1504/node-mojangson uses jison, but only as a dev dependency? Maybe its something else. The stackoverflow user says they fixed it in their case by "replacing that mindfuck exports part with a exports.parser = parser;"

if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
    exports.parser = parser;
    exports.Parser = parser.Parser;
    exports.parse = function () {
        return parser.parse.apply(parser, arguments);
    };
    exports.main = function commonjsMain(args){
        if(!args[1]){
            console.log("Usage: "+args[0]+" FILE");
            process.exit(1)
        }
        var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");
        return exports.parser.parse(source)
    };
    if (typeof module !== 'undefined' && require.main === module) {
        exports.main(process.argv.slice(1));
    }
}

and its using https://github.com/deathcap/jison/commits/modulemain which has deathcap/jison@83a3813.. for PrismarineJS/node-mojangson#4 Disable unused moduleMain code for browserify compatibility

@deathcap

deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member Author

There are differences in npm ls on voxel-clientmc/app, on my local system and circleci: https://gist.github.com/deathcap/1e530528e8fb3ae0d67b - mainly minor/patch version bumps

@rom1504

rom1504 commented Feb 8, 2016

Copy link
Copy Markdown

@deathcap I think I found your problem, the published grammar.js seems to still contain the cli thingy. republishing it in a bit.

@deathcap

deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member Author

@rom1504 cool thanks. reproduced locally was about to track it down =)

@rom1504

rom1504 commented Feb 8, 2016

Copy link
Copy Markdown

fixed in mojangson 0.2.3
just rerun circle ci (possibly without cache, not sure how it handle npm cache) and that should do it.

@deathcap

deathcap commented Feb 8, 2016

Copy link
Copy Markdown
Member Author

Updated and verified circleci is using mojangson 0.2.3 which has the main stub as expected:

exports.main = function (){};

so I think the problem with mojagson is fixed. Still getting this error though - maybe another problematic unbrowserifiable module:

voxel-clientmc $ ./app/node_modules/.bin/browserify app/app.js > app/wsmc/src/main/resources/www/bundle.js
Error: Cannot find module 'app/node_modules/is-buffer/index.js' from '/private/tmp/vc/voxel-clientmc'
  at /private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:46:17
  at process (/private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:173:43)
  at ondir (/private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:188:17)
  at load (/private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:69:43)
  at onex (/private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:92:31)
  at /private/tmp/vc/voxel-clientmc/app/node_modules/resolve/lib/async.js:22:47
  at FSReqWrap.oncomplete (fs.js:82:15)

ill need to isolate further..

deathcap added a commit that referenced this pull request Feb 8, 2016
@deathcap
deathcap merged commit 1bf52d6 into master Feb 8, 2016
@deathcap
deathcap deleted the circleci branch February 8, 2016 09:51
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

Successfully merging this pull request may close these issues.

2 participants