ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.06k stars 13.51k forks source link

Unable to npm react-native-package with IONIC REACT #18415

Closed manjunath143 closed 5 years ago

manjunath143 commented 5 years ago

Steps to reproduce :

We have a npm package react-native-ibm-mobilefirst which is used in react-native apps.We would like to use same package in Ionic React apps.We are getting below errors .

`main.chunk.js:30 Uncaught Error: Cannot find module 'react-native' at webpackMissingModule (main.chunk.js:30) at Module../src/App.js (main.chunk.js:30) at webpack_require (bundle.js:782) at fn (bundle.js:150) at Module../src/index.js (main.chunk.js:197) at webpack_require (bundle.js:782) at fn (bundle.js:150) at Object.0 (main.chunk.js:324) at webpack_require (bundle.js:782) at checkDeferredModules (bundle.js:46) at Array.webpackJsonpCallback [as push] (bundle.js:33) at main.chunk.js:1 webpackMissingModule @ main.chunk.js:30 ./src/App.js @ main.chunk.js:30 webpack_require @ bundle.js:782 fn @ bundle.js:150 ./src/index.js @ main.chunk.js:197 webpack_require @ bundle.js:782 fn @ bundle.js:150 0 @ main.chunk.js:324 webpack_require @ bundle.js:782 checkDeferredModules @ bundle.js:46 webpackJsonpCallback @ bundle.js:33 (anonymous) @ main.chunk.js:1 Show 12 more frames 0.chunk.js:28842 ./node_modules/react-native-ibm-mobilefirst/wlAnalytics.js SyntaxError: /Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/node_modules/react-native-ibm-mobilefirst/wlAnalytics.js: Support for the experimental syntax 'classProperties' isn't currently enabled (46:15):

44 | Accepted values for device events 45 | /

46 | DeviceEvent = { | ^ 47 | LIFECYCLE: "appSession", 48 | NETWORK: "network" 49 | }

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation. console. @ 0.chunk.js:28842 handleErrors @ 0.chunk.js:4963 push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ 0.chunk.js:5006 push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ 0.chunk.js:33694 (anonymous) @ 0.chunk.js:34495 push../node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ 0.chunk.js:34493 push../node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ 0.chunk.js:33588 WebSocketTransport.ws.onmessage @ 0.chunk.js:36814 Show 8 more frames 0.chunk.js:28842 ./node_modules/react-native-ibm-mobilefirst/wlClient.js SyntaxError: /Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/node_modules/react-native-ibm-mobilefirst/wlClient.js: Unexpected token, expected "," (41:76)

39 | /* THE FOLLOWING LINE OF CODE SHOULD NOT BE COMMENTED. IT IS ONLY COMMENTED OUT FOR DOC GENERATION / 40 | if (Platform.OS === 'ios') {

41 | eventEmitter.addListener('mobileFirstExceptionEvent', function(e: Event) { | ^ 42 | console.error("Exception occurred "); 43 | console.error("Message : " + e.message); 44 | console.error("Cause : " + e.cause); console. @ 0.chunk.js:28842 handleErrors @ 0.chunk.js:4963 push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ 0.chunk.js:5006 push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ 0.chunk.js:33694 (anonymous) @ 0.chunk.js:34495 push../node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ 0.chunk.js:34493 push../node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ 0.chunk.js:33588 WebSocketTransport.ws.onmessage @ 0.chunk.js:36814 Show 8 more frames 0.chunk.js:28842 ./node_modules/react-native-ibm-mobilefirst/wlAuthorizationManager.js Module not found: Can't resolve 'react-native' in '/Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/node_modules/react-native-ibm-mobilefirst' console. @ 0.chunk.js:28842 handleErrors @ 0.chunk.js:4963 push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ 0.chunk.js:5006 push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ 0.chunk.js:33694 (anonymous) @ 0.chunk.js:34495 push../node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ 0.chunk.js:34493 push../node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ 0.chunk.js:33588 WebSocketTransport.ws.onmessage @ 0.chunk.js:36814 Show 8 more frames 0.chunk.js:28842 ./node_modules/react-native-ibm-mobilefirst/wlResourceRequest.js Module not found: Can't resolve 'react-native' in '/Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/node_modules/react-native-ibm-mobilefirst' console. @ 0.chunk.js:28842 handleErrors @ 0.chunk.js:4963 push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ 0.chunk.js:5006 push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ 0.chunk.js:33694 (anonymous) @ 0.chunk.js:34495 push../node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ 0.chunk.js:34493 push../node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ 0.chunk.js:33588 WebSocketTransport.ws.onmessage @ 0.chunk.js:36814 Show 8 more frames 0.chunk.js:28842 ./node_modules/react-native-ibm-mobilefirst/wlLogger.js Module not found: Can't resolve 'react-native' in '/Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/node_modules/react-native-ibm-mobilefirst' console. @ 0.chunk.js:28842 handleErrors @ 0.chunk.js:4963 push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage @ 0.chunk.js:5006 push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent @ 0.chunk.js:33694 (anonymous) @ 0.chunk.js:34495 push../node_modules/sockjs-client/lib/main.js.SockJS._transportMessage @ 0.chunk.js:34493 push../node_modules/sockjs-client/lib/event/emitter.js.EventEmitter.emit @ 0.chunk.js:33588 WebSocketTransport.ws.onmessage @ 0.chunk.js:36814 Show 8 more frames 0.chunk.js:28842 ./src/App.js Module not found: Can't resolve 'react-native' in '/Users/manjuk/Documents/IFIX_JULY_TESTING/reactronicapp/src'`

Steps to reproduce : npx create-react-app my-ionic-app --typescript cd my-ionic-app npm install react-native-ibm-mobilefirst npm i npm start

Kindly help us to know if this react-native-ibm-mobilefirst package is whether compatible with ionic reacts apps .

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue appears to be a support request. We use this issue tracker exclusively for bug reports and feature requests. Please use our forum or our slack channel for questions about the framework.

Thank you for using Ionic!