Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 9 - Geo Query works on SSR but not on the client side #148

Open
tskweres opened this issue Jul 15, 2020 · 2 comments
Open

Angular 9 - Geo Query works on SSR but not on the client side #148

tskweres opened this issue Jul 15, 2020 · 2 comments

Comments

@tskweres
Copy link

I'm doing a compound query like the example:

query = geoFire.query(query).within(userPoint, 100, 'point');

When I subscribe to this query, for some reason on the server side it returns the correct results, but on the client side it's a blank array. Has anyone else run into this issue?

@tskweres
Copy link
Author

Perhaps this is an Angular 9 issue? Here's my package.json:

{
  "name": "web",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "dev:ssr": "ng run web:serve-ssr",
    "serve:ssr": "node dist/web/server/main.js",
    "build:ssr": "ng build --prod && ng run web:server:production",
    "prerender": "ng run web:prerender"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^9.1.11",
    "@angular/common": "~9.1.11",
    "@angular/compiler": "~9.1.11",
    "@angular/core": "~9.1.11",
    "@angular/fire": "^6.0.0",
    "@angular/forms": "~9.1.11",
    "@angular/platform-browser": "~9.1.11",
    "@angular/platform-browser-dynamic": "~9.1.11",
    "@angular/platform-server": "~9.1.11",
    "@angular/router": "~9.1.11",
    "@google-cloud/firestore": "^4.0.0",
    "@grpc/proto-loader": "^0.5.4",
    "@nguniversal/express-engine": "^9.1.1",
    "@types/googlemaps": "^3.39.7",
    "bulma": "^0.9.0",
    "express": "^4.15.2",
    "firebase": "^7.15.3",
    "fsevents": "^2.1.2",
    "geofirex": "^0.1.0",
    "geolib": "^3.3.1",
    "lodash.throttle": "^4.1.1",
    "ng2-material-dropdown": "^0.11.0",
    "ng5-slider": "^1.2.4",
    "ngeohash": "^0.6.3",
    "ngx-cookie": "^4.1.2",
    "ngx-google-places-autocomplete": "^2.0.4",
    "ngx-mask": "^9.0.2",
    "ngx-swiper-wrapper": "^9.0.1",
    "ngx-timeago": "^1.0.4",
    "ngx-toastr": "^12.0.0",
    "preboot": "^6.0.0",
    "rxjs": "~6.5.4",
    "rxjs-compat": "^6.5.5",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.901.9",
    "@angular-devkit/build-angular": "~0.901.9",
    "@angular/cli": "~9.1.9",
    "@angular/compiler-cli": "~9.1.11",
    "@angular/language-service": "~9.1.11",
    "@nguniversal/builders": "^9.1.1",
    "@types/express": "^4.17.0",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^14.0.13",
    "bufferutil": "^4.0.1",
    "codelyzer": "^5.1.2",
    "domino": "^2.1.4",
    "firebase-tools": "^8.4.3",
    "fuzzy": "^0.1.3",
    "inquirer": "^7.2.0",
    "inquirer-autocomplete-prompt": "^1.0.1",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~5.0.2",
    "karma": "~5.1.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~3.3.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~7.0.0",
    "ts-node": "~8.10.2",
    "tslint": "~6.1.2",
    "typescript": "3.8.3",
    "utf-8-validate": "^5.0.2",
    "ws": "^7.2.3",
    "xhr2": "^0.2.0"
  }
}

@tskweres tskweres changed the title Geo Query works on SSR but not on the client side Angular 9 - Geo Query works on SSR but not on the client side Jul 15, 2020
@tskweres
Copy link
Author

Fixed it in index.esm.js:

line 1455:

var _a = center.geopoint, centerLat = _a.latitude, centerLng = _a.longitude;
**CORRECTED** var _a = center.geopoint, centerLat = _a._lat, centerLng = _a._long;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant