Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tracked properties sometimes throw error when updated #416

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

Closed
JaySunSyn opened this issue Oct 28, 2016 · 6 comments
Closed

Tracked properties sometimes throw error when updated #416

JaySunSyn opened this issue Oct 28, 2016 · 6 comments

Comments

@JaySunSyn
Copy link

JaySunSyn commented Oct 28, 2016

Thanks for your work!

js-data.js:6623 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined

image

version: 3.0.0-rc.5

changed:undefined
changing:true
current:"http://localhost:8000/media/images/blabla/8679ae5a-4f7.jpg"
index:undefined
previous: undefined
this: undefined
@JaySunSyn JaySunSyn changed the title Tracked variables sometimes throws error when updated: js-data.js:6623 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined Tracked properties sometimes throw error when updated: js-data.js:6623 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined Oct 28, 2016
@jmdobry jmdobry changed the title Tracked properties sometimes throw error when updated: js-data.js:6623 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined Tracked properties sometimes throw error when updated Oct 29, 2016
@jmdobry
Copy link
Member

jmdobry commented Feb 20, 2017

Somehow I missed this issue. I have never seen this error, could you possible create a JSFiddle or Plunker with which I can reproduce the issue?

@rquast
Copy link

rquast commented Mar 6, 2017

I am getting this one too (rc4).. updating to rc9 to see if it is still happening.

Don't know how to reproduce since it randomly happens.

@rquast
Copy link

rquast commented Mar 7, 2017

I removed change tracking and I no longer get this issue. Tested on RC9.

@BennyAlex
Copy link

BennyAlex commented Dec 8, 2017

@jmdobry
Hello, I get the error in my application, too. It happens every time when I call record.save() in specific methode.
When I set track: false in the schema, the error doesnt occur.

Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined
at Record.descriptor.set [as id] (js-data.js?2812:7181)
at Object.deepMixIn (js-data.js?2812:521)
at postProcess (js-data.js?2812:4395)
at
descriptor.set @ js-data.js?2812:7181
deepMixIn @ js-data.js?2812:521
postProcess @ js-data.js?2812:4395
Promise rejected (async)
_callee4$ @ NewHolidays.vue?8bbd:224
tryCatch @ runtime.js?4a57:65
invoke @ runtime.js?4a57:299
prototype.(anonymous function) @ runtime.js?4a57:117
tryCatch @ runtime.js?4a57:65
maybeInvokeDelegate @ runtime.js?4a57:361
invoke @ runtime.js?4a57:273
prototype.(anonymous function) @ runtime.js?4a57:117
step @ asyncToGenerator.js?7b11:17
(anonymous) @ asyncToGenerator.js?7b11:28
Promise resolved (async)
step @ asyncToGenerator.js?7b11:27
(anonymous) @ asyncToGenerator.js?7b11:28
Promise resolved (async)
step @ asyncToGenerator.js?7b11:27
(anonymous) @ asyncToGenerator.js?7b11:28
Promise resolved (async)
step @ asyncToGenerator.js?7b11:27
(anonymous) @ asyncToGenerator.js?7b11:35
F @ _export.js?90cd:35
(anonymous) @ asyncToGenerator.js?7b11:14
saveAbsentDays @ NewHolidays.vue?8bbd:227
boundFn @ vue.runtime.esm.js?ff9b:188
invoker @ vue.runtime.esm.js?ff9b:1982
Vue.$emit @ vue.runtime.esm.js?ff9b:2492
click @ vuetify.js?dc48:6260
boundFn @ vue.runtime.esm.js?ff9b:188
invoker @ vue.runtime.esm.js?ff9b:1982
fn._withTask.fn._withTask @ vue.runtime.esm.js?ff9b:1780

@jmdobry
Copy link
Member

jmdobry commented Dec 8, 2017

@BennyAlex Could you create a plunker or stackblitz or jsfiddle or something with code that reproduces the error?

@phortx
Copy link

phortx commented Jan 24, 2018

I'm having this issue too. Seems like it happens when there are properties in a newly created model which are undefined (having no default value and don't have been set between creation and saving) and then new values come from the server.

When you make sure you have default values for every property you don't set after creation, everything works.

I think this is a bug. js-data should allow to have empty properties when saving a new model.

jmdobry pushed a commit that referenced this issue Feb 14, 2018
Make sure 'changing' and 'changed' are set together
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants