You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The eventsource package is a pure JavaScript implementation of the EventSource client which aims to be W3C compatible and provides a simple solution for real-time notifications over http which is especially useful in mobile apps.
Funnily EventSource works when debugging JS Remotely as it's able to use the built-in EventSource in Chrome, but doesn't work when debugging is disabled as it fails with:
Can't find variable: EventSource
Then trying to import the JavaScript eventsource:
yarn add eventsource
fails with similar results in npm or yarn when trying to import it:
global.EventSource=require('eventsource');
iOS displays an error page with Unable to resolve module {module_name} from ../node_modules/eventsource/lib/eventsource.js. First it fails with url module, which I then import with:
Then when all these modules are added if ends up failing with Unable to resolve module https... even though it's already added. This exact failing sequence also happened before I had yarn installed.
Solution
The error is due to failing to load core node.js modules so it looks like it's either a module loading error or react-native doesn't support these core node.js modules. It would help with compatibility of other packages if react-native had built-in support for these core modules.
Additional Information
React Native version: latest react-native 0.42.0
Platform: iOS
Operating System: OSX 10.12.3 (Sierra)
The text was updated successfully, but these errors were encountered:
The eventsource package is a pure JavaScript implementation of the EventSource client which aims to be W3C compatible and provides a simple solution for real-time notifications over http which is especially useful in mobile apps.
Funnily
EventSource
works when debugging JS Remotely as it's able to use the built-inEventSource
in Chrome, but doesn't work when debugging is disabled as it fails with:Then trying to import the JavaScript eventsource:
fails with similar results in npm or yarn when trying to import it:
iOS displays an error page with Unable to resolve module {module_name} from
../node_modules/eventsource/lib/eventsource.js
. First it fails with url module, which I then import with:Then it continues with the same error page for the following core modules used by eventsource:
Then when all these modules are added if ends up failing with Unable to resolve module https... even though it's already added. This exact failing sequence also happened before I had yarn installed.
Solution
The error is due to failing to load core node.js modules so it looks like it's either a module loading error or react-native doesn't support these core node.js modules. It would help with compatibility of other packages if react-native had built-in support for these core modules.
Additional Information
The text was updated successfully, but these errors were encountered: