Closed JongGyuChoi closed 4 years ago
I have a similar error. can add
resolver: {
assetExts: [...assetExts, 'css'],
},
to metro.config.js
to be able to load the .css
-file, but I also get errors for:
'node_modules/@highcharts/highcharts-react-native/highcharts-files/highcharts.js' cannot be loaded as its extension is not registered in assetExts
and if I try to add 'js'
to assetExts
the entire bundle seems to break.
edit: I'm using Expo
Im closing the ticket as duplicate of https://github.com/highcharts/highcharts-react-native/issues/39
@J-Zeitler Were you able to resolve the issue without setting the useCDN and useSSL to true???
@anacnfalcao I actually made my own wrapper. use one plain html-file with the highcharts js css etc that I need and then bootstrap it with my own webview. Something like this:
const html = await fetch(Expo.Asset.fromModule(require('./highcharts.html')).uri)
.then(f => f.text())
instead of the equivalent (I suppose): https://github.com/highcharts/highcharts-react-native/blob/f188b1a1f8cba516c904d7435719ce28293ac03e/dist/src/HighchartsReactNative.js#L26-L27
It's a bit ugly but I got it to work with Expo that way without any special configuration.
Why its so ugly, maybe its a solution as "additioanl option" for our wrapper. What do you think?
@J-Zeitler Were you able to resolve the issue without setting the useCDN and useSSL to true??? https://github.com/highcharts/highcharts-react-native/issues/39#issuecomment-662896823 I think it can help you.
Error: 'node_modules/@highcharts/highcharts-react-native/highcharts-layout/css/styles.css' cannot be loaded as its extension is not registered in assetExts
why this error occurred?