Hello,
I am trying to run datauri in a RN application. However, when I run the application, I get the following error:
undefined is not an object (evaluating 'version.trim').
I am importing
datauri as import { sync as DataURI } from 'datauri';
Maybe this is an issue related to using metro for building the react native application, similar to the webpack issue.
Here is my package .json
{ "name": "democracynow_reactNative", "version": "0.0.1", "private": true, "scripts": { "test": "jest" }, "dependencies": { "axios": "^0.18.0", "axios-mock-adapter": "^1.14.1", "datauri": "^1.1.0", "html-entities": "^1.2.1", "native-base": "^2.4.4", "react": "^16.2.0", "react-dom": "^16.2.0", "react-native": "^0.53.3", "react-native-config": "^0.11.5", "react-native-navigation": "^1.1.108", "react-native-orientation": "^3.1.3", "react-native-progress": "^3.4.0", "react-native-render-html": "^3.10.0", "react-native-video": "3.1.0", "react-native-windows": "^0.41.0-rc.0", "react-redux": "^5.0.7", "redux": "^3.7.2", "redux-promise": "^0.5.3", "striptags": "^3.1.1", "w3c-xmlhttprequest": "^2.1.2" }, "devDependencies": { "babel-jest": "20.0.3", "babel-plugin-import-rename": "^1.0.1", "babel-preset-react-native": "2.0.0", "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.1", "jest": "20.0.4", "react-native-config-node": "0.0.2", "react-test-renderer": "16.0.0-alpha.12", "redux-mock-store": "^1.5.1" }, "jest": { "preset": "react-native", "setupTestFrameworkScriptFile": "<rootDir>/app/__tests__/setup_tests.js", "testRegex": "__tests__/.*\\.spec.js$" }, "rnpm": { "assets": [ "./assets/fonts/" ] } }