-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Underlying object for changeset is missing... #464
Comments
👋 Can you try the function approach? I don't think it should matter so I'm a bit confused atm.
|
Sadly, same result... |
On a lark, I decided to blow away |
I don't have ember-cli installed globally, so I'm running it with |
Do you have a minimal repo that I could test with? |
I'll let you know when I have it ready. |
I'm also having this issue:
{{#with (changeset model.meals (action this.validateMeal)) as |changesetObj|}}
<form {{on "submit" (fn this.addMeal changesetObj)}}>
<Input @value={{changesetObj.name}} class="input" placeholder="Name" />
</form>
{{/with}}
export default class MealsController extends Controller {
@action
addMeal (changeset) {
event.preventDefault();
const newMeal = this.store.createRecord('meal', {
name: changeset.name,
});
changeset.save();
} When calling the I feel like this may be the same underlying cause, but I'm not sure. Ember : 3.18.1 |
@michael-lowe-nz Looks like we have tests somewhat close to this exact scenario.
A minimally reproducible application would be useful as well! |
I may make a minimally reproducible application, but what I don't quite understand is about what the
@action
export default class ListController extends Controller {
validateMeal(val) {
console.log('val', val);
}
}
export default class ListRoute extends Route.extend(RealtimeRouteMixin, PerformanceRouteMixin) {
model(params) {
return this.store.findRecord('list', params.list_id);
}
}
import Model, { attr, hasMany } from '@ember-data/model';
export default class ListModel extends Model {
@attr('string') name;
@hasMany('meal') meals;
}
{{#with (changeset model.meals (action this.validateMeal)) as |changesetObj|}}
<form {{on "submit" (fn this.addMeal changesetObj)}}>
<label>Meal Name</label>
<Input @value={{changesetObj.name}} class="input" placeholder="Name" />
</form>
{{/with}} Hopefully this makes sense, otherwise in what form would I make minimally reproducible application? |
I haven't forgotten about this; it'll likely be early next week. |
https://github.com/poteto/ember-changeset/commits/master I'm seeing some strange behaviour with CI (all ember-try scenarios passing locally). I'm not sure what has changed since our last commit to master 9 days ago (which was ✅). If you have some insight with respect to what you are seeing, would love to hear it and if it might be related! #472 |
Does anybody have a local reproduction with the latest |
@snewcomer i'm seeing this issue with 3.4.1 |
Does anybody have a local reproduction we can all try? Even an ember-twiddle? Perhaps there is a silent error? |
@snewcomer i'll try to pull enough out for a reproduction copy this weekend. For me it's happening when i try transitioning to a different route. I Can interact with it no problem up to that point. |
Ohhh. Ok that is great information. I have been hitting this with helpers (not changeset) in the apps I work on during/after a route transition. |
@snewcomer, i tested your PR against our app and it solved the problem we were having 👍 |
Awesome - I was working on the repro, but nice work fixing it without it!
…On Fri, Jun 5, 2020, 2:29 PM Scott Newcomer ***@***.***> wrote:
Closed #464 <#464> via
#501 <#501>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#464 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGW5XGF6NFMUFVVV2CB6H3RVFBP3ANCNFSM4MT6EKKQ>
.
|
(...but it's not)
Version
ember-cli: 3.17.0
ember-changeset: 3.3.1
ember-cli-typescript: 3.1.3
Test Case
given: a component that expects a changeset as a property
(this is in a closed-source project; I can't provide a link to the repo, but I can provide more information if you'd like)
Steps to reproduce
npx ember test
Expected Behavior
The test should continue, and render the component using the changeset.
Actual Behavior
The test fails on the indicated line above, with the error
Error: Assertion Failed. Underlying object for changeset is missing
.It may be significant (or not) that the result is the same whether the file ends with
.js
or.ts
; this doesn't appear (to me) to be an Ember TypeScript edge case.The text was updated successfully, but these errors were encountered: