anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.14k stars 557 forks source link

Can this work with React Native? #173

Closed whittlem closed 4 years ago

whittlem commented 5 years ago

Does "technicalindicators" work with React Native?

I installed it with: "yum add technicalindicators"

And have tried loading the library with these: import { SMA } from 'technicalindicators'; import SMA from 'technicalindicators'; const { SMA } = require('technicalindicators');

I am getting this error message:

error: bundling failed: Error: Unable to resolve module path from app/node_modules/technicalindicators/dist/index.js: Module path does not exist in the Haste module map

Any ideas?

whittlem commented 5 years ago

I installed the "path" and "fs" dependencies...

yarn add path yarn add fs

And now getting this error message:

error: bundling failed: Error: While trying to resolve module fs from file app/node_modules/@tensorflow/tfjs-node/dist/io/file_system.js, the package app/node_modules/fs/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (app/node_modules/fs/index.js. Indeed, none of these files exist:

anandanand84 commented 5 years ago

It should work. If you cannot add it as part of build. You can use the built .js file from https://github.com/anandanand84/technicalindicators/tree/master/dist

whittlem commented 5 years ago

@anandanand84, I copied the contents of the link above to ./assets/technicalindicators

I then tried to import it like this: import { SMA } from './assets/technicalindicators';

In React / React Native it will load the index.js in the directly if not specified.

error: bundling failed: Error: Unable to resolve module @tensorflow/tfjs from /app/assets/tradecrypto/index.js: Module @tensorflow/tfjs does not exist in the Haste module map

What should I do here? I would normally add the dependencies but if I have the build file this shouldn't be necessary right?

Are you able to help?

whittlem commented 5 years ago

@anandanand84, any news with this?

anandanand84 commented 4 years ago

Tensorflow removed in version 3.0. It should work now.