{"action":"created","issue":{"url":"https://api.github.com/repos/polkadot-js/api/issues/481","repository_url":"https://api.github.com/repos/polkadot-js/api","labels_url":"https://api.github.com/repos/polkadot-js/api/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/polkadot-js/api/issues/481/comments","events_url":"https://api.github.com/repos/polkadot-js/api/issues/481/events","html_url":"https://github.com/polkadot-js/api/issues/481","id":391676686,"node_id":"MDU6SXNzdWUzOTE2NzY2ODY=","number":481,"title":"Import the polkadot-api in React-Native, The error summary","user":{"login":"jiangfuyao","id":34789555,"node_id":"MDQ6VXNlcjM0Nzg5NTU1","avatar_url":"https://avatars0.githubusercontent.com/u/34789555?v=4","gravatar_id":"","url":"https://api.github.com/users/jiangfuyao","html_url":"https://github.com/jiangfuyao","followers_url":"https://api.github.com/users/jiangfuyao/followers","following_url":"https://api.github.com/users/jiangfuyao/following{/other_user}","gists_url":"https://api.github.com/users/jiangfuyao/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangfuyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangfuyao/subscriptions","organizations_url":"https://api.github.com/users/jiangfuyao/orgs","repos_url":"https://api.github.com/users/jiangfuyao/repos","events_url":"https://api.github.com/users/jiangfuyao/events{/privacy}","received_events_url":"https://api.github.com/users/jiangfuyao/received_events","type":"User","site_admin":false},"labels":[{"id":780379444,"node_id":"MDU6TGFiZWw3ODAzNzk0NDQ=","url":"https://api.github.com/repos/polkadot-js/api/labels/@api","name":"@api","color":"fbca04","default":false},{"id":754052503,"node_id":"MDU6TGFiZWw3NTQwNTI1MDM=","url":"https://api.github.com/repos/polkadot-js/api/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-12-17T11:48:46Z","updated_at":"2018-12-18T13:35:15Z","closed_at":null,"author_association":"NONE","body":"  **polkadot Api version** : \r\n```\r\n    \"@polkadot/api\": \"^0.33.17\",\r\n    \"@polkadot/rpc-provider\": \"^0.33.17\"\r\n```\r\n**This React-Native project create way is** :\r\n `react-native init Project`\r\n```\r\ncd Project\r\nreact-native run-android\r\n```\r\n\r\n**packages**:\r\n```\r\n\"dependencies\": {\r\n    \"axios\": \"0.18.0\",\r\n    \"ethers\": \"3.0.27\",\r\n    \"identicon.js\": \"2.3.2\",\r\n    \"mobx\": \"^4.3.1\",\r\n    \"mobx-react\": \"5.2.5\",\r\n    \"moment\": \"2.22.2\",\r\n    \"react\": \"16.4.2\",\r\n    \"react-native\": \"0.56.0\",\r\n    \"react-native-camera\": \"1.2.0\",\r\n    \"react-native-modal\": \"6.5.0\",\r\n    \"react-native-permissions\": \"1.1.1\",\r\n    \"react-native-qrcode-svg\": \"5.1.0\",\r\n    \"react-native-sensitive-info\": \"5.2.4\",\r\n    \"react-native-snackbar\": \"0.5.0\",\r\n    \"react-native-svg\": \"6.5.2\",\r\n    \"react-native-vector-icons\": \"5.0.0\",\r\n    \"react-navigation\": \"2.12.1\",\r\n    \"@polkadot/api\": \"^0.33.17\",\r\n    \"@polkadot/rpc-provider\": \"^0.33.17\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@babel/core\": \"7.0.0-beta.47\",\r\n    \"@babel/plugin-proposal-decorators\": \"7.0.0-beta.47\",\r\n    \"@babel/plugin-transform-runtime\": \"7.0.0-beta.47\",\r\n    \"@babel/runtime\": \"7.0.0-beta.47\",\r\n    \"babel-core\": \"7.0.0-bridge.0\",\r\n    \"babel-jest\": \"23.4.2\",\r\n    \"babel-plugin-module-resolver\": \"3.1.1\",\r\n    \"babel-preset-react-native\": \"5.0.2\",\r\n    \"enzyme\": \"3.5.0\",\r\n    \"enzyme-adapter-react-16\": \"1.3.0\",\r\n    \"eslint-config-rallycoding\": \"3.2.0\",\r\n    \"jest\": \"23.5.0\",\r\n    \"jsdom\": \"12.0.0\",\r\n    \"react-native-mock-render\": \"0.1.1\",\r\n    \"react-test-renderer\": \"16.4.2\",\r\n    \"rimraf\": \"^2.6.2\"\r\n  },\r\n```\r\n\r\n**When I import the @polkadot/api to **React Native** project. get the error**:\r\n```\r\nerror: bundling failed: Error: Unable to resolve module `core-js/modules/es6.regexp.to-string` from `/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/@polkadot/util/logger.js`: Module `core-js/modules/es6.regexp.to-string` does not exist in the Haste module map\r\n\r\nThis might be related to https://github.com/facebook/react-native/issues/4968\r\nTo resolve try the following:\r\n  1. Clear watchman watches: `watchman watch-del-all`.\r\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\r\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\r\n\r\n```\r\n![_ _20181217193346](https://user-images.githubusercontent.com/34789555/50085161-373fe500-0234-11e9-8c66-caabe7751988.png)\r\n\r\n```\r\nThe development server returned response error code: 500\r\n\r\nURL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false\r\n\r\nBody:\r\n{\"originModulePath\":\"/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/@polkadot/util/logger.js\",\"targetModuleName\":\"core-js/modules/es6.regexp.to-string\",\"message\":\"Unable to resolve module `core-js/modules/es6.regexp.to-string` from `/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/@polkadot/util/logger.js`: Module `core-js/modules/es6.regexp.to-string` does not exist in the Haste module map\\n\\nThis might be related to https://github.com/facebook/react-native/issues/4968\\nTo resolve try the following:\\n  1. Clear watchman watches: `watchman watch-del-all`.\\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\",\"errors\":[{\"description\":\"Unable to resolve module `core-js/modules/es6.regexp.to-string` from `/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/@polkadot/util/logger.js`: Module `core-js/modules/es6.regexp.to-string` does not exist in the Haste module map\\n\\nThis might be related to https://github.com/facebook/react-native/issues/4968\\nTo resolve try the following:\\n  1. Clear watchman watches: `watchman watch-del-all`.\\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\"}],\"name\":\"Error\",\"stack\":\"Error: Unable to resolve module `core-js/modules/es6.regexp.to-string` from `/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/@polkadot/util/logger.js`: Module `core-js/modules/es6.regexp.to-string` does not exist in the Haste module map\\n\\nThis might be related to https://github.com/facebook/react-native/issues/4968\\nTo resolve try the following:\\n  1. Clear watchman watches: `watchman watch-del-all`.\\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\\n    at ModuleResolver.resolveDependency (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:167:1306)\\n    at ResolutionRequest.resolveDependency (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:80:16)\\n    at DependencyGraph.resolveDependency (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/node-haste/DependencyGraph.js:237:485)\\n    at Object.resolve (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/lib/transformHelpers.js:116:25)\\n    at dependencies.map.result (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:298:29)\\n    at Array.map (<anonymous>)\\n    at resolveDependencies (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:294:16)\\n    at /media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:159:33\\n    at Generator.next (<anonymous>)\\n    at step (/media/threebody/DATA/Desktop/github/ethereum-wallet/node_modules/metro/src/DeltaBundler/traverseDependencies.js:239:307)\"}\r\nprocessBundleResult\r\n    BundleDownloader.java:285\r\naccess$200\r\n    BundleDownloader.java:37\r\nonResponse\r\n    BundleDownloader.java:163\r\nexecute\r\n    RealCall.java:153\r\nrun\r\n    NamedRunnable.java:32\r\nrunWorker\r\n    ThreadPoolExecutor.java:1162\r\nrun\r\n    ThreadPoolExecutor.java:636\r\nrun\r\n    Thread.java:764\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/polkadot-js/api/issues/comments/448222833","html_url":"https://github.com/polkadot-js/api/issues/481#issuecomment-448222833","issue_url":"https://api.github.com/repos/polkadot-js/api/issues/481","id":448222833,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODIyMjgzMw==","user":{"login":"jiangfuyao","id":34789555,"node_id":"MDQ6VXNlcjM0Nzg5NTU1","avatar_url":"https://avatars0.githubusercontent.com/u/34789555?v=4","gravatar_id":"","url":"https://api.github.com/users/jiangfuyao","html_url":"https://github.com/jiangfuyao","followers_url":"https://api.github.com/users/jiangfuyao/followers","following_url":"https://api.github.com/users/jiangfuyao/following{/other_user}","gists_url":"https://api.github.com/users/jiangfuyao/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangfuyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangfuyao/subscriptions","organizations_url":"https://api.github.com/users/jiangfuyao/orgs","repos_url":"https://api.github.com/users/jiangfuyao/repos","events_url":"https://api.github.com/users/jiangfuyao/events{/privacy}","received_events_url":"https://api.github.com/users/jiangfuyao/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T13:35:15Z","updated_at":"2018-12-18T13:35:15Z","author_association":"NONE","body":"## Now the @polkadot packages import to RN state:\r\n\r\n\r\n- [ ] //const { ApiPromise } = require('@polkadot/api/promise'); //class extends issue\r\n- [x]  const { testApi1 } = require('@polkadot/dev'); // import is ok\r\n- [x]  const { testapi2 } = require('@polkadot/jsonrpc'); // import is ok\r\n- [x]  const { testapi3 } = require('@polkadot/extrinsics'); //import is ok \r\n- [x]  const { testapi4 } = require('@polkadot/keyring'); // import is ok\r\n- [x]  const { testapi6 } = require('@polkadot/rpc-provider'); //import is ok\r\n- [x]  const { testapi11 } = require('@polkadot/util'); // import is ok\r\n- [x]  const { WsProvider } = require('@polkadot/rpc-provider');  //import is ok\r\n- [x]  const { testapi12 } = require('@polkadot/util-crypto'); //import is ok\r\n- [ ] // const { testapi7 } = require('@polkadot/rpc-rx'); //class extends issue\r\n- [ ] // const { testapi5 } = require('@polkadot/rpc-core'); //class extends issue\r\n- [ ] // const { testapi8 } = require('@polkadot/storage'); //class extends issue\r\n- [ ] //const { testapi9 } = require('@polkadot/ts'); // The development server returned response error code: 500 ()\r\n- [ ] // const { testapi10 } = require('@polkadot/types'); //class extends issue"}}
{"actor":{"display_login":"jiangfuyao"}}