bitpay / node-bitpay-client

A Node.js module and command line client for interacting with BitPay's Cryptographically Secure API
103 stars 95 forks source link

ES6 / webpack support #78

Open yogiben opened 8 years ago

yogiben commented 8 years ago

I think there's a problem with the paths.

Sometimes it's looking for the wrong modules e.g. /Users/gringo/dev/bitwala/bitwala/v2/node_modules/bitauth/lib/bitauth.js the filename is actually bitauth-node.js.

While processing files with webpack:webpack (for target os.osx.x86_64):
   src/server.js: ./~/bitauth/lib/bitauth.js
   Module build failed: Error: ENOENT, open
   '/Users/gringo/dev/bitwala/bitwala/v2/node_modules/bitauth/lib/bitauth.js'
   @ ./~/bitauth/index.js 2:14-38
   src/server.js: ./~/bignum/test/buf.js
   Module not found: Error: Cannot resolve module 'put' in
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/bignum/test
   resolve module put in /Users/gringo/dev/bitwala/bitwala/v2/node_modules/bignum/test
   looking for modules in /Users/gringo/dev/bitwala/bitwala/v2/src
   /Users/gringo/dev/bitwala/bitwala/v2/src/put doesn't exist (module as directory)
   resolve 'file' put in /Users/gringo/dev/bitwala/bitwala/v2/src
   resolve file
   /Users/gringo/dev/bitwala/bitwala/v2/src/put doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/src/put.js doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/src/put.jsx doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/src/put.css doesn't exist
   looking for modules in /Users/gringo/dev/bitwala/bitwala/v2/node_modules
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/put doesn't exist (module as directory)
   resolve 'file' put in /Users/gringo/dev/bitwala/bitwala/v2/node_modules
   resolve file
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/put doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.js doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.jsx doesn't exist
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.css doesn't exist
   [/Users/gringo/dev/bitwala/bitwala/v2/src/put]
   [/Users/gringo/dev/bitwala/bitwala/v2/src/put]
   [/Users/gringo/dev/bitwala/bitwala/v2/src/put.js]
   [/Users/gringo/dev/bitwala/bitwala/v2/src/put.jsx]
   [/Users/gringo/dev/bitwala/bitwala/v2/src/put.css]
   [/Users/gringo/dev/bitwala/bitwala/v2/node_modules/put]
   [/Users/gringo/dev/bitwala/bitwala/v2/node_modules/put]
   [/Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.js]
   [/Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.jsx]
   [/Users/gringo/dev/bitwala/bitwala/v2/node_modules/put.css]
   @ ./~/bignum/test/buf.js 3:10-24
   src/server.js: ./~/tough-cookie/package.json
   Module parse failed: /Users/gringo/dev/bitwala/bitwala/v2/node_modules/tough-cookie/package.json
   Line 2: Unexpected token :
   You may need an appropriate loader to handle this file type.
   | {
   |   "_args": [
   |     [
   |       "tough-cookie@~2.2.0",
   @ ./~/tough-cookie/lib/cookie.js 38:14-40
   src/server.js: ./~/hawk/package.json
   Module parse failed: /Users/gringo/dev/bitwala/bitwala/v2/node_modules/hawk/package.json Line 2:
   Unexpected token :
   You may need an appropriate loader to handle this file type.
   | {
   |   "_args": [
   |     [
   |       "hawk@~3.1.3",
   @ ./~/hawk/lib/utils.js 14:11-37
   src/server.js: ./~/mime-db/db.json
   Module parse failed: /Users/gringo/dev/bitwala/bitwala/v2/node_modules/mime-db/db.json Line 2:
   Unexpected token :
   You may need an appropriate loader to handle this file type.
   | {
   |   "application/1d-interleaved-parityfec": {
   |     "source": "iana"
   |   },
   @ ./~/mime-db/index.js 11:17-37
   src/server.js: ./~/har-validator/lib/schemas/cache.json
   Module parse failed:
   /Users/gringo/dev/bitwala/bitwala/v2/node_modules/har-validator/lib/schemas/cache.json Line 2:
   Unexpected token :
   You may need an appropriate loader to handle this file type.
   | {
   |   "properties": {
   |     "beforeRequest": {
   |       "$ref": "#cacheEntry"
   @ ./~/har-validator/lib/schemas/index.js 4:9-32
   src/server.js: ./~/har-validator/lib/schemas/content.json
   Module parse failed:
kleetus commented 8 years ago

does this issue relate to node-bitpay-client or bitauth? Also, can you elaborate on how you are using bitauth or the node-bitpay-client? What I mean, specifically, is that I know that you are using webpack, but can you tell me if you are including node-bitpay-client in a web framework that uses webpack for a module bundler?

yogiben commented 8 years ago

The context is a MeteorJS application. I haven't had an issue with other node modules.