zoltan-nz / library-app

Detailed Ember.js v4.7 tutorial for absolute beginners. https://yoember.com
http://library-app.firebaseapp.com
195 stars 77 forks source link

_parent.type is undefined #20

Closed sureshprasanna70 closed 5 years ago

sureshprasanna70 commented 5 years ago

I'm on lesson 6 where we work on seeding the database with randomly generated data. I'm able to generate seed data for library. I'm facing issues when it comes to generating authors and books. The issue pops up only if the record count is more than 1. You can view my code here https://github.com/sureshprasanna70/yoember.

FIREBASE WARNING: Exception was thrown by user callback. getFirstEmbeddingParent@http://localhost:4200/assets/vendor.js:146509:13
_getAbsoluteRef@http://localhost:4200/assets/vendor.js:146469:34
updateRecord@http://localhost:4200/assets/vendor.js:146225:28
createRecord@http://localhost:4200/assets/vendor.js:146205:19
_commit/promise<@http://localhost:4200/assets/vendor.js:137203:77
tryCatcher@http://localhost:4200/assets/vendor.js:63901:21
invokeCallback@http://localhost:4200/assets/vendor.js:64073:33
then/<@http://localhost:4200/assets/vendor.js:64137:16
@http://localhost:4200/assets/vendor.js:58989:16
invoke@http://localhost:4200/assets/vendor.js:57473:24
flush@http://localhost:4200/assets/vendor.js:57385:25
flush@http://localhost:4200/assets/vendor.js:57558:31
_end@http://localhost:4200/assets/vendor.js:58056:42
end@http://localhost:4200/assets/vendor.js:57776:18
_run@http://localhost:4200/assets/vendor.js:58101:26
run@http://localhost:4200/assets/vendor.js:57819:25
run@http://localhost:4200/assets/vendor.js:46165:27
callback@http://localhost:4200/assets/vendor.js:147407:29
jb/<@http://localhost:4200/assets/vendor.js:122574:1149
Ah/<@http://localhost:4200/assets/vendor.js:122748:49
fc@http://localhost:4200/assets/vendor.js:122587:166
Ah@http://localhost:4200/assets/vendor.js:122748:24
g.update/<@http://localhost:4200/assets/vendor.js:122744:435
Kg/<@http://localhost:4200/assets/vendor.js:122705:168
g.wd@http://localhost:4200/assets/vendor.js:122706:105
og.prototype.wd@http://localhost:4200/assets/vendor.js:122696:365
qg/<@http://localhost:4200/assets/vendor.js:122694:282
ag@http://localhost:4200/assets/vendor.js:122678:465
Yf.prototype.open/this.Ia.onmessage@http://localhost:4200/assets/vendor.js:122677:246
_selectRandomLibrary@http://localhost:4200/assets/yoember.js:295:7
_generateSomeBooks@http://localhost:4200/assets/yoember.js:271:30
generateBooksAndAuthors/books<@http://localhost:4200/assets/yoember.js:223:73
tryCatcher@http://localhost:4200/assets/vendor.js:63901:21
invokeCallback@http://localhost:4200/assets/vendor.js:64073:33
publish@http://localhost:4200/assets/vendor.js:64059:9
@http://localhost:4200/assets/vendor.js:58989:16
invoke@http://localhost:4200/assets/vendor.js:57473:24
flush@http://localhost:4200/assets/vendor.js:57385:25
flush@http://localhost:4200/assets/vendor.js:57558:31
_end@http://localhost:4200/assets/vendor.js:58056:42
end@http://localhost:4200/assets/vendor.js:57776:18
_run@http://localhost:4200/assets/vendor.js:58101:26
run@http://localhost:4200/assets/vendor.js:57819:25
run@http://localhost:4200/assets/vendor.js:46165:27
callback@http://localhost:4200/assets/vendor.js:147407:29
jb/<@http://localhost:4200/assets/vendor.js:122574:1149
Ah/<@http://localhost:4200/assets/vendor.js:122748:49
fc@http://localhost:4200/assets/vendor.js:122587:166
Ah@http://localhost:4200/assets/vendor.js:122748:24
g.update/<@http://localhost:4200/assets/vendor.js:122744:435
Kg/<@http://localhost:4200/assets/vendor.js:122705:168
g.wd@http://localhost:4200/assets/vendor.js:122706:105
og.prototype.wd@http://localhost:4200/assets/vendor.js:122696:365
qg/<@http://localhost:4200/assets/vendor.js:122694:282
ag@http://localhost:4200/assets/vendor.js:122678:465
Yf.prototype.open/this.Ia.onmessage@http://localhost:4200/assets/vendor.js:122677:246
 firebase.amd.js:853
TypeError: _parent.type is undefined firebase.js:689

My package.json

{
  "name": "yoember",
  "version": "0.0.0",
  "private": true,
  "description": "Small description for yoember goes here",
  "repository": "",
  "license": "MIT",
  "author": "",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "lint:hbs": "ember-template-lint .",
    "lint:js": "eslint .",
    "start": "ember serve",
    "test": "ember test"
  },
  "devDependencies": {
    "@ember/jquery": "^0.5.2",
    "@ember/optional-features": "^0.6.3",
    "broccoli-asset-rev": "^2.7.0",
    "ember-ajax": "^3.1.0",
    "ember-cli": "~3.7.1",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.1.2",
    "ember-cli-bootstrap-sassy": "^0.5.8",
    "ember-cli-dependency-checker": "^3.0.0",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-htmlbars": "^3.0.0",
    "ember-cli-htmlbars-inline-precompile": "^1.0.3",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-sass": "^10.0.1",
    "ember-cli-shims": "^1.2.0",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "^2.1.0",
    "ember-data": "~3.7.0",
    "ember-export-application-global": "^2.0.0",
    "ember-faker": "^1.5.0",
    "ember-load-initializers": "^1.1.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "^5.0.1",
    "ember-source": "~3.7.0",
    "ember-welcome-page": "^3.2.0",
    "emberfire": "^2.0.10",
    "eslint-plugin-ember": "^5.2.0",
    "loader.js": "^4.7.0",
    "qunit-dom": "^0.8.0",
    "sass": "^1.20.1"
  },
  "engines": {
    "node": "6.* || 8.* || >= 10.*"
  }
}

Any help would be appreciated. Thanks

zoltan-nz commented 5 years ago

Hi @sureshprasanna70, great job so far. Well done. Keep up the great work. :)

I suppose you see these issues because EmberFire v2 is not really compatible with Ember v3.6 and above... As I noticed you use v3.7. The stable EmberFire v3 haven't released yet, but we are close, I think.

Try the followings. Change ember-data and ember-source version to ~3.4.0 and run npm install... What do you see?

sureshprasanna70 commented 5 years ago

Hi @zoltan-nz downgrading ember-data and ember-source to ~3.4.0 did the trick.

zoltan-nz commented 5 years ago

Thanks for confirming... hope we can update the tutorial soon when the final EmberFire v3 will be released.