Comments (13)
@JiaLiPassion - it looks like Googlebot does not like Zone.js 0.9.0 either: angular/angular#30203
from zone.js.
Thanks, I will look into it.
from zone.js.
Could you provide a reproduce repo? Thanks
from zone.js.
Is that the most useful thing I can do? To reproduce it from code, you're going to need a JDK installation and an Android device or emulator to hand. If you have those things, it's enough to react-native init TestApp
, npm i zone.js
, import 'zone.js'
in index.js
and make a call to fetch
.
In other news, FileReader is also broken. Am I doing something dumb? How should I import Zone.js in a React Native application?
from zone.js.
I never tried using zone.js
in react native
, and I don't think you did any thing wrong, the most possible reason is in react native
, the webview
has different implementation vs normal browser. So if you can provide a very basic repo to reproduce fetch and FileReader
issue, so I don't need to begin to learn how to setup react native 101
. Thanks!
from zone.js.
OK, I've created a repo at https://github.com/sdc395/react-native-zones.git
.
I had no problems using Zone.js with React Native 0.56. The sooner Zones becomes a standard part of JavaScript the better. :-)
from zone.js.
@sdc395, it seems react native
implement it's own EventTarget
and XMLHttpRequest
, and it is inside Worker
, so the patch
become a little weird, so in your use case, you want to use zone
to control XMLHttpRequest
and FileReader
?
from zone.js.
At the moment, I'm only knowingly using Zone.js to make database transaction objects available to asynchronous functions that need database access.
Perhaps I can disable the Zone.js patches I don't need. I had set __Zone_disable_XHR = true
. Do I need to set __Zone_disable_EventTarget = true
also? Could you clarify the steps?
Thanks for your help with this issue.
from zone.js.
@sdc395, yes, you are right, the walk around is,
- create a
env.js
in the root.
if (typeof global !== 'undefined') {
global['__Zone_disable_XHR'] = true;
global['__Zone_disable_EventTarget'] = true;
}
- in
index.js
, beforeimport zone.js
,
/**
* @format
*/
import './env';
import 'zone.js';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
And everything should work fine.
from zone.js.
That has done the trick, although I've only needed to disable EventTarget patching (so far). Thanks so much.
Will full, on-going support for React Native be available in the future? I'm building my mobile app's database access around Zone.js and I'd hate to have to rip that out post-launch.
from zone.js.
I have issue with version 0.9.0 too. I've recently updated all packages in project and Angular to version 7.2.13. Core-js is on version 3.0.1. After every request, zone.js throw this error: TypeError: Cannot read property 'call' of undefined at ZoneTask.scheduleTask [as scheduleFn].
Call of undefined is on this line: oriAddListener.call(target, READY_STATE_CHANGE, newListener);
We work with LG smart TV with webOS version 3.8.0 (latest LG update).
Here is stacktrace:
"TypeError: Cannot read property 'call' of undefined at ZoneTask.scheduleTask [as scheduleFn] (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:12611:27) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:9688:26) at Object.push../node_modules/zone.js/dist/zone.js.DELEGATE_ZS.onScheduleTask (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:9579:29) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:9682:51) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:9516:43) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.scheduleMacroTask (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:9539:25) at scheduleMacroTaskWithCurrentZone (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:10472:25) at file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:12649:28 at proto.(anonymous function) [as send] (file:///media/developer/apps/usr/palm/applications/app/dist/polyfills.js:10796:24) at Observable._subscribe (file:///media/developer/apps/usr/palm/applications/app/dist/main.js:8049:17)"
After downgrading to zone.js version 0.8.29, application works
from zone.js.
@petebacondarwin, got it, I will check it, thanks!
from zone.js.
I will close this one because angular/angular#30203 has been fixed.
from zone.js.
Related Issues (20)
- Suspicious code in promise.ts HOT 1
- Error: ReferenceError: Zone is not defined HOT 12
- phantomjs
- Missing tag for v0.8.27 release HOT 2
- zone.js breaks IndexedDB on Safari via EventTarget monkey patch
- Upgrade this repo and add support to Jasmine 3.3 HOT 11
- Upgrading to karma 3.0.0, failure of test cases HOT 2
- microTask 'Promise.then': can not transition to 'running', expecting state 'scheduled', was 'scheduling'. HOT 3
- Zone long stack traces generates wrong stack trace HOT 1
- Evergreen bundle missing in dist HOT 2
- Provide example for using in plain JavaScript Node.js app HOT 5
- Browser extensions have window.customElements defined as null
- ServiseWorker compatiblitity issues in 0.9.0 HOT 1
- fakeAsync patch for requestAnimationFrame is not passing the timestamp HOT 4
- SyntaxError: Unexpected token
- Angular elements in another angular project: ERROR Error: Expected to not be in Angular Zone, but it is! HOT 4
- window.Zone Already Defined by Other Library HOT 8
- HTMLCanvasElement.toBlob() is no longer patched in 0.9.1 HOT 2
- WTF_ISSUE_555 loop garbage collection / unfunctional HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zone.js.