fhqvst / avanza

A JavaScript client for the unofficial Avanza API
MIT License
228 stars 59 forks source link

example not working #31

Closed tabenius closed 4 years ago

tabenius commented 5 years ago

I have 2-factor auth and can use

node -e "console.log(require('avanza/dist/totp')('my_secret_here'))"

to get codes which log me in to avanza web. However, running the example script gives me this error:

(node:31061) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'protocol' of undefined
    at Object.http.request (/home/tabenius/Projects/2019avanza/static/js/main.min.js:32622:40)
    at Object.https.request (/home/tabenius/Projects/2019avanza/static/js/main.min.js:20214:23)
    at /home/tabenius/Projects/2019avanza/static/js/main.min.js:3079:21
    at new Promise (<anonymous>)
    at request (/home/tabenius/Projects/2019avanza/static/js/main.min.js:3078:10)
    at /home/tabenius/Projects/2019avanza/static/js/main.min.js:3479:9
    at new Promise (<anonymous>)
    at Avanza.authenticate (/home/tabenius/Projects/2019avanza/static/js/main.min.js:3473:14)
    at Object.214.avanza (/home/tabenius/Projects/2019avanza/static/js/main.min.js:37497:8)
    at o (/home/tabenius/Projects/2019avanza/static/js/main.min.js:1:327)
(node:31061) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31061) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I have nodejs --version v8.10.0

and

npm list

/home/tabenius/Projects/2019avanza ├─┬ avanza@2.0.0 │ └─┬ ws@3.2.0 │ ├── async-limiter@1.0.0 │ ├── safe-buffer@5.1.2 │ └── ultron@1.1.1 ├─┬ babel-cli@6.26.0 │ ├─┬ babel-core@6.26.3 │ │ ├─┬ babel-code-frame@6.26.0 │ │ │ ├─┬ chalk@1.1.3 │ │ │ │ ├── ansi-styles@2.2.1 │ │ │ │ ├── escape-string-regexp@1.0.5 │ │ │ │ ├─┬ has-ansi@2.0.0 │ │ │ │ │ └── ansi-regex@2.1.1 │ │ │ │ ├── strip-ansi@3.0.1 │ │ │ │ └── supports-color@2.0.0 │ │ │ └── esutils@2.0.2 │ │ ├─┬ babel-generator@6.26.1 │ │ │ ├─┬ detect-indent@4.0.0 │ │ │ │ └─┬ repeating@2.0.1 │ │ │ │ └─┬ is-finite@1.0.2 │ │ │ │ └── number-is-nan@1.0.1 │ │ │ ├── jsesc@1.3.0 │ │ │ └── trim-right@1.0.1 │ │ ├── babel-helpers@6.24.1 │ │ ├── babel-messages@6.23.0 │ │ ├── babel-template@6.26.0 │ │ ├─┬ babel-traverse@6.26.0 │ │ │ ├── globals@9.18.0 │ │ │ └── invariant@2.2.4 │ │ ├─┬ babel-types@6.26.0 │ │ │ └── to-fast-properties@1.0.3 │ │ ├── babylon@6.18.0 │ │ ├── convert-source-map@1.6.0 │ │ ├─┬ debug@2.6.9 │ │ │ └── ms@2.0.0 │ │ ├── json5@0.5.1 │ │ ├─┬ minimatch@3.0.4 │ │ │ └─┬ brace-expansion@1.1.11 │ │ │ ├── balanced-match@1.0.0 │ │ │ └── concat-map@0.0.1 │ │ └── private@0.1.8 │ ├─┬ babel-polyfill@6.26.0 │ │ ├── core-js@2.6.5 │ │ └── regenerator-runtime@0.10.5 │ ├─┬ babel-register@6.26.0 │ │ ├─┬ home-or-tmp@2.0.0 │ │ │ ├── os-homedir@1.0.2 │ │ │ └── os-tmpdir@1.0.2 │ │ └── source-map-support@0.4.18 │ ├─┬ babel-runtime@6.26.0 │ │ └── regenerator-runtime@0.11.1 │ ├─┬ chokidar@1.7.0 │ │ ├─┬ anymatch@1.3.2 │ │ │ ├─┬ micromatch@2.3.11 │ │ │ │ ├─┬ arr-diff@2.0.0 │ │ │ │ │ └── arr-flatten@1.1.0 │ │ │ │ ├── array-unique@0.2.1 │ │ │ │ ├─┬ braces@1.8.5 │ │ │ │ │ ├─┬ expand-range@1.8.2 │ │ │ │ │ │ └─┬ fill-range@2.2.4 │ │ │ │ │ │ ├── is-number@2.1.0 │ │ │ │ │ │ ├── isobject@2.1.0 │ │ │ │ │ │ └─┬ randomatic@3.1.1 │ │ │ │ │ │ ├── is-number@4.0.0 │ │ │ │ │ │ ├── kind-of@6.0.2 │ │ │ │ │ │ └── math-random@1.0.4 │ │ │ │ │ ├── preserve@0.2.0 │ │ │ │ │ └── repeat-element@1.1.3 │ │ │ │ ├─┬ expand-brackets@0.1.5 │ │ │ │ │ └── is-posix-bracket@0.1.1 │ │ │ │ ├── extglob@0.3.2 │ │ │ │ ├── filename-regex@2.0.1 │ │ │ │ ├── kind-of@3.2.2 │ │ │ │ ├─┬ object.omit@2.0.1 │ │ │ │ │ ├─┬ for-own@0.1.5 │ │ │ │ │ │ └── for-in@1.0.2 │ │ │ │ │ └── is-extendable@0.1.1 │ │ │ │ ├─┬ parse-glob@3.0.4 │ │ │ │ │ ├── glob-base@0.3.0 │ │ │ │ │ └── is-dotfile@1.0.3 │ │ │ │ └─┬ regex-cache@0.4.4 │ │ │ │ └─┬ is-equal-shallow@0.1.3 │ │ │ │ └── is-primitive@2.0.0 │ │ │ └─┬ normalize-path@2.1.1 │ │ │ └── remove-trailing-separator@1.1.0 │ │ ├── async-each@1.0.3 │ │ ├── UNMET OPTIONAL DEPENDENCY fsevents@^1.0.0 │ │ ├── glob-parent@2.0.0 │ │ ├─┬ is-binary-path@1.0.1 │ │ │ └── binary-extensions@1.13.1 │ │ ├─┬ is-glob@2.0.1 │ │ │ └── is-extglob@1.0.0 │ │ └─┬ readdirp@2.2.1 │ │ └─┬ micromatch@3.1.10 │ │ ├── arr-diff@4.0.0 │ │ ├── array-unique@0.3.2 │ │ ├─┬ braces@2.3.2 │ │ │ ├── extend-shallow@2.0.1 │ │ │ ├─┬ fill-range@4.0.0 │ │ │ │ ├── extend-shallow@2.0.1 │ │ │ │ ├─┬ is-number@3.0.0 │ │ │ │ │ └── kind-of@3.2.2 │ │ │ │ ├── repeat-string@1.6.1 │ │ │ │ └─┬ to-regex-range@2.1.1 │ │ │ │ └── is-number@3.0.0 │ │ │ ├── isobject@3.0.1 │ │ │ ├─┬ snapdragon-node@2.1.1 │ │ │ │ ├─┬ define-property@1.0.0 │ │ │ │ │ └─┬ is-descriptor@1.0.2 │ │ │ │ │ ├── is-accessor-descriptor@1.0.0 │ │ │ │ │ ├── is-data-descriptor@1.0.0 │ │ │ │ │ └── kind-of@6.0.2 │ │ │ │ ├── isobject@3.0.1 │ │ │ │ └── snapdragon-util@3.0.1 │ │ │ └── split-string@3.1.0 │ │ ├─┬ define-property@2.0.2 │ │ │ ├─┬ is-descriptor@1.0.2 │ │ │ │ ├── is-accessor-descriptor@1.0.0 │ │ │ │ ├── is-data-descriptor@1.0.0 │ │ │ │ └── kind-of@6.0.2 │ │ │ └── isobject@3.0.1 │ │ ├─┬ extend-shallow@3.0.2 │ │ │ ├── assign-symbols@1.0.0 │ │ │ └─┬ is-extendable@1.0.1 │ │ │ └─┬ is-plain-object@2.0.4 │ │ │ └── isobject@3.0.1 │ │ ├─┬ extglob@2.0.4 │ │ │ ├─┬ define-property@1.0.0 │ │ │ │ └─┬ is-descriptor@1.0.2 │ │ │ │ ├── is-accessor-descriptor@1.0.0 │ │ │ │ └── is-data-descriptor@1.0.0 │ │ │ ├─┬ expand-brackets@2.1.4 │ │ │ │ ├─┬ define-property@0.2.5 │ │ │ │ │ └─┬ is-descriptor@0.1.6 │ │ │ │ │ ├─┬ is-accessor-descriptor@0.1.6 │ │ │ │ │ │ └── kind-of@3.2.2 │ │ │ │ │ ├─┬ is-data-descriptor@0.1.4 │ │ │ │ │ │ └── kind-of@3.2.2 │ │ │ │ │ └── kind-of@5.1.0 │ │ │ │ ├── extend-shallow@2.0.1 │ │ │ │ └── posix-character-classes@0.1.1 │ │ │ └── extend-shallow@2.0.1 │ │ ├─┬ fragment-cache@0.2.1 │ │ │ └── map-cache@0.2.2 │ │ ├── kind-of@6.0.2 │ │ ├─┬ nanomatch@1.2.13 │ │ │ ├── arr-diff@4.0.0 │ │ │ ├── array-unique@0.3.2 │ │ │ ├── is-windows@1.0.2 │ │ │ └── kind-of@6.0.2 │ │ ├─┬ object.pick@1.3.0 │ │ │ └── isobject@3.0.1 │ │ ├─┬ regex-not@1.0.2 │ │ │ └─┬ safe-regex@1.1.0 │ │ │ └── ret@0.1.15 │ │ ├─┬ snapdragon@0.8.2 │ │ │ ├─┬ base@0.11.2 │ │ │ │ ├─┬ cache-base@1.0.1 │ │ │ │ │ ├─┬ collection-visit@1.0.0 │ │ │ │ │ │ ├── map-visit@1.0.0 │ │ │ │ │ │ └─┬ object-visit@1.0.1 │ │ │ │ │ │ └── isobject@3.0.1 │ │ │ │ │ ├── get-value@2.0.6 │ │ │ │ │ ├─┬ has-value@1.0.0 │ │ │ │ │ │ ├─┬ has-values@1.0.0 │ │ │ │ │ │ │ ├─┬ is-number@3.0.0 │ │ │ │ │ │ │ │ └── kind-of@3.2.2 │ │ │ │ │ │ │ └── kind-of@4.0.0 │ │ │ │ │ │ └── isobject@3.0.1 │ │ │ │ │ ├── isobject@3.0.1 │ │ │ │ │ ├─┬ set-value@2.0.0 │ │ │ │ │ │ └── extend-shallow@2.0.1 │ │ │ │ │ ├── to-object-path@0.3.0 │ │ │ │ │ ├─┬ union-value@1.0.0 │ │ │ │ │ │ └─┬ set-value@0.4.3 │ │ │ │ │ │ └── extend-shallow@2.0.1 │ │ │ │ │ └─┬ unset-value@1.0.0 │ │ │ │ │ ├─┬ has-value@0.3.1 │ │ │ │ │ │ ├── has-values@0.1.4 │ │ │ │ │ │ └── isobject@2.1.0 │ │ │ │ │ └── isobject@3.0.1 │ │ │ │ ├─┬ class-utils@0.3.6 │ │ │ │ │ ├── arr-union@3.1.0 │ │ │ │ │ ├── define-property@0.2.5 │ │ │ │ │ ├── isobject@3.0.1 │ │ │ │ │ └─┬ static-extend@0.1.2 │ │ │ │ │ ├── define-property@0.2.5 │ │ │ │ │ └─┬ object-copy@0.1.0 │ │ │ │ │ ├── copy-descriptor@0.1.1 │ │ │ │ │ └── define-property@0.2.5 │ │ │ │ ├── component-emitter@1.3.0 │ │ │ │ ├─┬ define-property@1.0.0 │ │ │ │ │ └─┬ is-descriptor@1.0.2 │ │ │ │ │ ├── is-accessor-descriptor@1.0.0 │ │ │ │ │ ├── is-data-descriptor@1.0.0 │ │ │ │ │ └── kind-of@6.0.2 │ │ │ │ ├── isobject@3.0.1 │ │ │ │ ├─┬ mixin-deep@1.3.1 │ │ │ │ │ └── is-extendable@1.0.1 │ │ │ │ └── pascalcase@0.1.1 │ │ │ ├─┬ define-property@0.2.5 │ │ │ │ └─┬ is-descriptor@0.1.6 │ │ │ │ ├── is-accessor-descriptor@0.1.6 │ │ │ │ ├── is-data-descriptor@0.1.4 │ │ │ │ └── kind-of@5.1.0 │ │ │ ├── extend-shallow@2.0.1 │ │ │ ├─┬ source-map-resolve@0.5.2 │ │ │ │ ├── atob@2.1.2 │ │ │ │ ├── decode-uri-component@0.2.0 │ │ │ │ ├── resolve-url@0.2.1 │ │ │ │ ├── source-map-url@0.4.0 │ │ │ │ └── urix@0.1.0 │ │ │ └── use@3.1.1 │ │ └── to-regex@3.0.2 │ ├── commander@2.20.0 │ ├── convert-source-map@1.6.0 │ ├── fs-readdir-recursive@1.1.0 │ ├─┬ glob@7.1.3 │ │ ├── fs.realpath@1.0.0 │ │ ├─┬ inflight@1.0.6 │ │ │ └── wrappy@1.0.2 │ │ └── once@1.4.0 │ ├── lodash@4.17.11 │ ├─┬ output-file-sync@1.1.2 │ │ └── graceful-fs@4.1.15 │ ├── path-is-absolute@1.0.1 │ ├── slash@1.0.0 │ ├── source-map@0.5.7 │ └─┬ v8flags@2.1.1 │ └── user-home@1.1.1 ├─┬ babel-preset-es2015@6.24.1 │ ├── babel-plugin-check-es2015-constants@6.22.0 │ ├── babel-plugin-transform-es2015-arrow-functions@6.22.0 │ ├── babel-plugin-transform-es2015-block-scoped-functions@6.22.0 │ ├── babel-plugin-transform-es2015-block-scoping@6.26.0 │ ├─┬ babel-plugin-transform-es2015-classes@6.24.1 │ │ ├── babel-helper-define-map@6.26.0 │ │ ├── babel-helper-function-name@6.24.1 │ │ ├── babel-helper-optimise-call-expression@6.24.1 │ │ └── babel-helper-replace-supers@6.24.1 │ ├── babel-plugin-transform-es2015-computed-properties@6.24.1 │ ├── babel-plugin-transform-es2015-destructuring@6.23.0 │ ├── babel-plugin-transform-es2015-duplicate-keys@6.24.1 │ ├── babel-plugin-transform-es2015-for-of@6.23.0 │ ├── babel-plugin-transform-es2015-function-name@6.24.1 │ ├── babel-plugin-transform-es2015-literals@6.22.0 │ ├── babel-plugin-transform-es2015-modules-amd@6.24.1 │ ├─┬ babel-plugin-transform-es2015-modules-commonjs@6.26.2 │ │ └── babel-plugin-transform-strict-mode@6.24.1 │ ├─┬ babel-plugin-transform-es2015-modules-systemjs@6.24.1 │ │ └── babel-helper-hoist-variables@6.24.1 │ ├── babel-plugin-transform-es2015-modules-umd@6.24.1 │ ├── babel-plugin-transform-es2015-object-super@6.24.1 │ ├─┬ babel-plugin-transform-es2015-parameters@6.24.1 │ │ ├── babel-helper-call-delegate@6.24.1 │ │ └── babel-helper-get-function-arity@6.24.1 │ ├── babel-plugin-transform-es2015-shorthand-properties@6.24.1 │ ├── babel-plugin-transform-es2015-spread@6.22.0 │ ├─┬ babel-plugin-transform-es2015-sticky-regex@6.24.1 │ │ └── babel-helper-regex@6.26.0 │ ├── babel-plugin-transform-es2015-template-literals@6.22.0 │ ├── babel-plugin-transform-es2015-typeof-symbol@6.23.0 │ ├─┬ babel-plugin-transform-es2015-unicode-regex@6.24.1 │ │ └─┬ regexpu-core@2.0.0 │ │ ├── regenerate@1.4.0 │ │ ├── regjsgen@0.2.0 │ │ └─┬ regjsparser@0.1.5 │ │ └── jsesc@0.5.0 │ └─┬ babel-plugin-transform-regenerator@6.26.0 │ └── regenerator-transform@0.10.1 ├─┬ babel-preset-react@6.24.1 │ ├── babel-plugin-syntax-jsx@6.18.0 │ ├── babel-plugin-transform-react-display-name@6.25.0 │ ├─┬ babel-plugin-transform-react-jsx@6.24.1 │ │ └── babel-helper-builder-react-jsx@6.26.0 │ ├── babel-plugin-transform-react-jsx-self@6.22.0 │ ├── babel-plugin-transform-react-jsx-source@6.22.0 │ └─┬ babel-preset-flow@6.23.0 │ └─┬ babel-plugin-transform-flow-strip-types@6.22.0 │ └── babel-plugin-syntax-flow@6.18.0 ├─┬ browserify@16.2.3 │ ├─┬ assert@1.4.1 │ │ └─┬ util@0.10.3 │ │ └── inherits@2.0.1 │ ├─┬ browser-pack@6.1.0 │ │ ├─┬ combine-source-map@0.8.0 │ │ │ ├── convert-source-map@1.1.3 │ │ │ ├── inline-source-map@0.6.2 │ │ │ └── lodash.memoize@3.0.4 │ │ └── umd@3.0.3 │ ├─┬ browser-resolve@1.11.3 │ │ └── resolve@1.1.7 │ ├─┬ browserify-zlib@0.2.0 │ │ └── pako@1.0.10 │ ├─┬ buffer@5.2.1 │ │ ├── base64-js@1.3.0 │ │ └── ieee754@1.1.13 │ ├── cached-path-relative@1.0.2 │ ├─┬ concat-stream@1.6.2 │ │ ├── buffer-from@1.1.1 │ │ └── typedarray@0.0.6 │ ├─┬ console-browserify@1.1.0 │ │ └── date-now@0.1.4 │ ├── constants-browserify@1.0.0 │ ├─┬ crypto-browserify@3.12.0 │ │ ├─┬ browserify-cipher@1.0.1 │ │ │ ├─┬ browserify-aes@1.2.0 │ │ │ │ └── buffer-xor@1.0.3 │ │ │ ├─┬ browserify-des@1.0.2 │ │ │ │ └── des.js@1.0.0 │ │ │ └── evp_bytestokey@1.0.3 │ │ ├─┬ browserify-sign@4.0.4 │ │ │ ├── bn.js@4.11.8 │ │ │ ├── browserify-rsa@4.0.1 │ │ │ ├─┬ elliptic@6.4.1 │ │ │ │ ├── brorand@1.1.0 │ │ │ │ ├── hash.js@1.1.7 │ │ │ │ ├── hmac-drbg@1.0.1 │ │ │ │ ├── minimalistic-assert@1.0.1 │ │ │ │ └── minimalistic-crypto-utils@1.0.1 │ │ │ └─┬ parse-asn1@5.1.4 │ │ │ └── asn1.js@4.10.1 │ │ ├── create-ecdh@4.0.3 │ │ ├─┬ create-hash@1.2.0 │ │ │ ├── cipher-base@1.0.4 │ │ │ ├─┬ md5.js@1.3.5 │ │ │ │ └── hash-base@3.0.4 │ │ │ └── ripemd160@2.0.2 │ │ ├── create-hmac@1.1.7 │ │ ├─┬ diffie-hellman@5.0.3 │ │ │ └── miller-rabin@4.0.1 │ │ ├── pbkdf2@3.0.17 │ │ ├── public-encrypt@4.0.3 │ │ ├── randombytes@2.1.0 │ │ └── randomfill@1.0.4 │ ├── defined@1.0.0 │ ├── deps-sort@2.0.0 │ ├── domain-browser@1.2.0 │ ├── duplexer2@0.1.4 │ ├── events@2.1.0 │ ├─┬ has@1.0.3 │ │ └── function-bind@1.1.1 │ ├── htmlescape@1.1.1 │ ├── https-browserify@1.0.0 │ ├── inherits@2.0.3 │ ├─┬ insert-module-globals@7.2.0 │ │ ├─┬ acorn-node@1.6.2 │ │ │ ├── acorn@6.1.1 │ │ │ ├── acorn-dynamic-import@4.0.0 │ │ │ └── acorn-walk@6.1.1 │ │ ├── is-buffer@1.1.6 │ │ └─┬ undeclared-identifiers@1.1.3 │ │ ├── dash-ast@1.0.0 │ │ ├── get-assigned-identifiers@1.2.0 │ │ └── simple-concat@1.0.0 │ ├─┬ JSONStream@1.3.5 │ │ ├── jsonparse@1.3.1 │ │ └── through@2.3.8 │ ├─┬ labeled-stream-splicer@2.0.1 │ │ ├── isarray@2.0.4 │ │ └── stream-splicer@2.0.0 │ ├─┬ mkdirp@0.5.1 │ │ └── minimist@0.0.8 │ ├─┬ module-deps@6.2.0 │ │ ├── detective@5.2.0 │ │ └── stream-combiner2@1.1.1 │ ├── os-browserify@0.3.0 │ ├─┬ parents@1.0.1 │ │ └── path-platform@0.11.15 │ ├── path-browserify@0.0.1 │ ├── process@0.11.10 │ ├── punycode@1.4.1 │ ├── querystring-es3@0.2.1 │ ├── read-only-stream@2.0.0 │ ├─┬ readable-stream@2.3.6 │ │ ├── core-util-is@1.0.2 │ │ ├── isarray@1.0.0 │ │ ├── process-nextick-args@2.0.0 │ │ ├── string_decoder@1.1.1 │ │ └── util-deprecate@1.0.2 │ ├─┬ resolve@1.10.0 │ │ └── path-parse@1.0.6 │ ├─┬ shasum@1.0.2 │ │ ├── json-stable-stringify@0.0.1 │ │ └── sha.js@2.4.11 │ ├─┬ shell-quote@1.6.1 │ │ ├── array-filter@0.0.1 │ │ ├── array-map@0.0.0 │ │ ├── array-reduce@0.0.0 │ │ └── jsonify@0.0.0 │ ├── stream-browserify@2.0.2 │ ├─┬ stream-http@2.8.3 │ │ ├── builtin-status-codes@3.0.0 │ │ └── to-arraybuffer@1.0.1 │ ├── string_decoder@1.2.0 │ ├─┬ subarg@1.0.0 │ │ └── minimist@1.2.0 │ ├── syntax-error@1.4.0 │ ├── through2@2.0.5 │ ├── timers-browserify@1.4.2 │ ├── tty-browserify@0.0.1 │ ├─┬ url@0.11.0 │ │ ├── punycode@1.3.2 │ │ └── querystring@0.2.0 │ ├── util@0.10.4 │ ├── vm-browserify@1.1.0 │ └── xtend@4.0.1 ├─┬ bufferutil@4.0.1 │ └── node-gyp-build@3.7.0 ├─┬ react@16.8.6 │ ├─┬ loose-envify@1.4.0 │ │ └── js-tokens@3.0.2 │ ├── object-assign@4.1.1 │ ├─┬ prop-types@15.7.2 │ │ └── react-is@16.8.6 │ └── scheduler@0.13.6 ├── react-dom@16.8.6 └── utf-8-validate@5.0.2

tabenius commented 5 years ago

strangely.. it works when I am not using browserify.

fhqvst commented 5 years ago

If you submit some code to reproduce I can look into it, otherwise I guess we can close this one.

tabenius commented 5 years ago
import Avanza from 'avanza'
const avanza = new Avanza()

avanza.authenticate({
  username: '6666666',
  password: 'xxxxxxxx',
  totpSecret: 'AAAAAAAAAAAAAAAA'
}).then( async () => {
  console.log("Logged in")
  const positions = await avanza.getPositions()
  console.log(positions)
})
#!/bin/bash -x 
handler() {
  kill -s SIGINT $pid
}
trap handler SIGINT
while true; do 
  echo "Transpiling with babel. Send SIGINT (Ctrl-c) when you want to browserify"
  node_modules/.bin/babel --presets react,es2015 --watch src/ --out-dir static/js &
  pid=$!
  wait $pid
  echo Browserifying
  #bsfy=browserify
  bsfy=./node_modules/.bin/browserify
    $bsfy static/js/main.js > static/js/main.min.js
done
tabenius commented 5 years ago

What I don't understand is why browserify makes it stop working.. Eventually I want to run it in the browser.. (while waiting to hopefully get a devalpha invite ;-) )