Conversation
|
Getting this mysterious error from browserify on CircleCI - never seen this locally.. |
|
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 |
|
There are differences in |
|
@deathcap I think I found your problem, the published grammar.js seems to still contain the cli thingy. republishing it in a bit. |
|
@rom1504 cool thanks. reproduced locally was about to track it down =) |
|
fixed in mojangson 0.2.3 |
|
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: ill need to isolate further.. |
#31