voxel51/api-js

README instructions are not correct on require statement to load client library

brimoor opened this issue · 2 comments

@hoddr I just tried to reinstall this client lib using the instructions in the README, and then I get this error:

> let voxel51 = require('.');
Error: Cannot find module './utils.js'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)

Any idea what's up?

hoddr commented

Probably order of imports. What works was:

// in lib/ folder
const voxel51 = require('./api.js');

We really should suggest using npm link to test locally (or better yet getting to a point where we can finally publish on npm and just say npm install @voxel51/api-js or the like and then const voxel51 = require('@voxel51/api-js');!

nvm I found the bug. It was an actual error in one of the modules index.html tried to import. Agree that we should publish to npm soon though.