react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

react-native-chart-kit breaks a fresh expo app

Open bkniffler opened this issue 8 years ago • 16 comments

Hey, if I install this library, expo crashes. As soon as I remove it, it works again.

Here is the error:


[13:05:34] \node_modules\babel-plugin-module-resolver\lib\index.js:88
[13:05:34]       })[1];
[13:05:34]         ^
[13:05:34]
[13:05:34] TypeError: Cannot read property '1' of undefined
[13:05:34]     at Plugin.manipulateOptions (\node_modules\babel-plugin-module-resolver\lib\index.js:88:9)
[13:05:34]     at normalizeOptions (\node_modules\@babel\core\lib\transformation\normalize-opts.js:59:16)
[13:05:34]     at runSync (\node_modules\@babel\core\lib\transformation\index.js:44:86)
[13:05:34]     at transformSync (\node_modules\@babel\core\lib\transform.js:43:38)
[13:05:34]     at Object.transform (\node_modules\@babel\core\lib\transform.js:22:38)
[13:05:34]     at compile (\node_modules\@babel\register\lib\node.js:73:20)
[13:05:34]     at compileHook (\node_modules\@babel\register\lib\node.js:102:12)
[13:05:34]     at Module._compile (\node_modules\pirates\lib\index.js:77:29)
[13:05:34]     at Module._extensions..js (internal/modules/cjs/loader.js:689:10)
[13:05:34]     at Object.newLoader [as .js] (\node_modules\pirates\lib\index.js:88:7)
[13:05:34] Metro Bundler process exited with code 1
[13:05:34] Error: Metro Bundler process exited with code 1
    at ChildProcess.<anonymous> (C:\[email protected]\src\Project.js:1496:14)
    at Generator.next (<anonymous>)
    at step (User\AppData\Local\Yarn\Data\global\node_modules\xdl\build\Project.js:2099:191)
    at User\AppData\Local\Yarn\Data\global\node_modules\xdl\build\Project.js:2099:437
    at new Promise (User\AppData\Local\Yarn\Data\global\node_modules\core-js\modules\es6.promise.js:177:7)
    at ChildProcess.<anonymous> (User\AppData\Local\Yarn\Data\global\node_modules\xdl\build\Project.js:2099:99)
    at ChildProcess.packagerProcess.once (C:\[email protected]\src\Project.js:1494:5)
    at Object.onceWrapper (events.js:275:13)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)

I noticed that the installed library is not transpiled.

bkniffler avatar Nov 20 '18 12:11 bkniffler

me too.

react-native-engineer avatar Nov 25 '18 15:11 react-native-engineer

+1

joaobsantos avatar Nov 26 '18 18:11 joaobsantos

same here.....

PhilTheAir avatar Nov 29 '18 02:11 PhilTheAir

and here..

gonzalovilaseca avatar Nov 29 '18 17:11 gonzalovilaseca

and me as well

ibaselyous avatar Dec 28 '18 21:12 ibaselyous

+1 me too

tphuc012 avatar Jan 04 '19 03:01 tphuc012

me too

RubenDeAndrade avatar Jan 07 '19 17:01 RubenDeAndrade

found an answer here:

eggie3 Nov '18 It seems like upgrading babel-plugin-module-resolver to version 3.1.1 solved that problem.

yarn add babel-plugin-module-resolver@latest worked for me

murray1337 avatar Jan 08 '19 20:01 murray1337

I tried that and it didn't work.

gonzalovilaseca avatar Jan 08 '19 20:01 gonzalovilaseca

Wouldn't it be a better fix to add a transpiling step before publishing so this does not need to happen in every instance if someone uses this library?

bkniffler avatar Jan 09 '19 12:01 bkniffler

After I put "LineChart" as sample into render() function. I't make my app crash after 5-10 seconds ("LineChart" visible ok as example). I'm using expo 32.0.0 and [email protected]

long241191 avatar Mar 28 '19 04:03 long241191

try to use react-native-pure-chart

react-native-engineer avatar Mar 28 '19 05:03 react-native-engineer

Tried all chart npms out there and none worked apart from react-native-pure-chart

charloh avatar May 28 '19 07:05 charloh

+1

matteo-pennisi avatar May 30 '19 14:05 matteo-pennisi

@charloh Victory charts works nicely and works on web+native.

bkniffler avatar May 30 '19 14:05 bkniffler

npm install react-native-svg solved the issue for me

Asa-Nisi-Masa avatar Apr 26 '24 22:04 Asa-Nisi-Masa