Gavant / ember-data-fastboot-route

Addon for handling the fastboot shoebox for each route
MIT License
5 stars 1 forks source link

Relationship data not stored in shoebox? #3

Open thomaswelton opened 7 years ago

thomaswelton commented 7 years ago

Data for relationships are not stored in the shoebox. Looks like a bug exists on a similar package https://github.com/cardstack/ember-data-fastboot/issues/5

bakerac4 commented 7 years ago

@thomaswelton I just released a beta version that I believe fixes this problem.

To install, just remove the old version from your node_modules folder and package.json and run the command npm install --save-dev ember-data-fastboot-route@beta.

Some notable changes 1) The addon can now handle any model, be it ember-data or a json object 2) You no longer need to include the calls to this._super in before and after model 3) A modelName property should no longer be required

thomaswelton commented 7 years ago

Thanks for this, but getting this error.

There was an error running your app in fastboot. More info about the error: 
 TypeError: Cannot read property 'replace' of undefined
    at Cache.func (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:48681:15)
    at Cache.get (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:27200:37)
    at decamelize (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:48723:29)
    at Cache.func (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:48629:12)
    at Cache.get (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:27200:37)
    at Object.dasherize (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:48727:35)
    at normalizeModelName (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:79521:37)
    at Class.modelNameFromPayloadKey (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:90825:104)
    at Class._extractType (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:90810:21)
    at Class.normalize (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:90852:20)
    at Class.normalize (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:85674:25)
    at /Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:73738:56
    at Array.map (native)
    at /Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:73736:28
    at Class.serializeEDModel (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:73745:23)
    at Class.serializeShoeboxModel (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:73898:41)
    at Class._serializeRouteModel (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:73859:37)
    at invokeWithOnError (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:10918:16)
    at Queue.flush (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:10977:9)
    at DeferredActionQueues.flush (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:11101:15)
    at Backburner.end (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:11171:23)
    at Backburner.run (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:11285:16)
    at Backburner.join (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:11316:23)
    at Function.run.join (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:33304:28)
    at Object.hash.success (/Users/thomaswelton/Sites/gindex-frontend/dist/fastboot/vendor-3bc991d3ca610499ead26e47fac700a3.js:88983:33)
    at fire (/Users/thomaswelton/Sites/gindex-frontend/node_modules/jquery-deferred/lib/jquery-callbacks.js:78:30)
    at Object.fireWith (/Users/thomaswelton/Sites/gindex-frontend/node_modules/jquery-deferred/lib/jquery-callbacks.js:188:7)
    at Object.fire [as resolve] (/Users/thomaswelton/Sites/gindex-frontend/node_modules/jquery-deferred/lib/jquery-callbacks.js:195:10)
    at dataHandler (/Users/thomaswelton/Sites/gindex-frontend/node_modules/najax/lib/najax.js:167:13)
    at IncomingMessage.<anonymous> (/Users/thomaswelton/Sites/gindex-frontend/node_modules/najax/lib/najax.js:198:9)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:186:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)
bakerac4 commented 7 years ago

@thomaswelton Would you be able to provide a repo that reproduces this issue?

If thats not possible, could you provide me with the model that Class.serializeEDModel is trying to serialize?

benkingcode commented 7 years ago

@bakerac4 I also got this error from just;

model() {
    return this.store.query('user', {});
}