max-mapper / voxel-engine

3D HTML5 voxel game engine
http://maxogden.github.com/voxel-engine
BSD 3-Clause "New" or "Revised" License
1.29k stars 220 forks source link

esprima-six module is not reachable anymore #120

Open andrewtheone opened 8 years ago

andrewtheone commented 8 years ago

I try to install ndarray branch, because of the "plugins" and transparency, and i get an error saying "esprima-six" is not maintend anymore. Any ideas?

max-mapper commented 8 years ago

Bah sorry, the author unpublished it from NPM recently (a really bad practice as it breaks code like this) https://www.npmjs.com/package/esprima-six, https://twitter.com/mattdesl/status/676897307380576257. It's possible this module might work instead but I'm not sure https://www.npmjs.com/package/esprima

andrewtheone commented 8 years ago

What i could find out is, voxel-engine is depending on voxel-shader which has a module which depends on awts which depended on esprima-six. if i download the voxel-engine github zip, remove the voxel-shader, npm install it, then download voxel-shader, put it in voxel-engine/node_modules, npm_install the voxel-shader then i want to browserify my index.js, and the browserify stops with an error: "undefined is not a function..." and pointing at aoshader.js in voxel-shader.

any idea how to make it work?

max-mapper commented 8 years ago

I just published this: https://www.npmjs.com/package/esprima-six-legacy, maybe try replacing 'esprima-six' in the awts package.json with 'esprima-six-legacy'?

andrewtheone commented 8 years ago

thats gona be a long run i believe finding the right packages, i'll report back

andrewtheone commented 8 years ago

so it finally builds with browserify, but then again, now i'm getting a more strange error when i visit index.html:

Uncaught Error: Error compiling vertex shader: ERROR: 0:18: '=' : global variable initializers must be constant expressions createShader @ bundle.js:28004(anonymous function) @ bundle.js:27569ShaderPlugin.createAOShader @ bundle.js:27508ShaderPlugin.ginit @ bundle.js:27431EventEmitter.emit @ bundle.js:8485initGLNow @ bundle.js:18492EventEmitter.emit @ bundle.js:8467initGameShell @ bundle.js:19699 13bundle.js:27454 Uncaught Error: voxel-shader render() called before gl-init, shader=

index.js content:

var createGame = require('voxel-engine'); var game = createGame({}); var container = document.body; game.appendTo(container);

andrewtheone commented 8 years ago

all i wanted is having some half-transparent blocks.. that was roughly 12 hours ago, and sitting here without them, dissapointing

max-mapper commented 8 years ago

@andrewtheone sorry, this project has been inactive for a while so it seems some things are broken

deathcap commented 8 years ago

@andrewtheone I ran into both these problems and fixed them yesterday I believe:

https://github.com/voxel/voxel-shader/issues/11 gl-shader: Error compling vertex shader: ERROR: 0:18: '=' : global variable initializers must be constant expressions https://github.com/deathcap/voxelmetaverse/issues/60 nonexistent dependency (esprima-six unpublished)

(I too was surprised how a module could "spontaneously" break… unfortunately a weakness of NPM, where a dependency can be unpublished then break all dependent projects, not only voxel.js was affected: http://stackoverflow.com/questions/33608630/what-happened-to-the-esprima-six-npm-module - but it should be fixed now in the latest voxel-shader, voxel-decals, voxel-mesher, voxel-webview and gl-css3d 1.0.0. The global variable shader error was my fault though, appears that the code was illegal but previously accepted by browsers, either way, fixed now :)).

Can you try voxel-engine-stackgl 1.0.1, it has both these fixes (voxel-engine-stackgl replaces voxel-engine ndarray branch). Not sure if voxel-engine master branch is broken though.