question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Underlying object for changeset is missing...

See original GitHub issue

(…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

import { module, test } from 'qunit'
import { setupRenderingTest } from 'ember-qunit'
import { render } from '@ember/test-helpers'
import { hbs } from 'ember-cli-htmlbars'

import Changeset from 'ember-changeset'

module('Integration | Component | my-component', function(hooks) {
  setupRenderingTest(hooks)

  test('it renders', async function(assert) {
    const obj = { bob: 'tom' }
    assert.ok(Boolean(obj), 'This should be true') // <- this, the same assert from the library, passes
    // @ts-ignore
    this.set('changeset', new Changeset(obj)) // <- this bombs with the above error
    // ...remainder of test ellided...
  })
})

(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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:18

github_iconTop GitHub Comments

1reaction
danieljsummerscommented, May 12, 2020

I haven’t forgotten about this; it’ll likely be early next week.

1reaction
snewcomercommented, Apr 29, 2020

👋 Can you try the function approach? I don’t think it should matter so I’m a bit confused atm.

import { Changeset } from 'ember-changeset';

... = Changeset(obj)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ecto.Changeset — Ecto v3.9.4 - HexDocs
Applies the changeset changes to the changeset data. This operation will return the underlying data with changes regardless if the changeset is valid...
Read more >
Changelog Formats | Liquibase Docs
The changeset tag is a unit of change that Liquibase executes on a database and which is used to group database Liquibase Change...
Read more >
validated-changeset - npm
On rollback, all changes are dropped and the underlying Object is left untouched. Full API. Changeset(model, lookupValidator(validationMap) ...
Read more >
Migrate CRM Analytics Assets with Change Sets
That is, if you add a dataset to a change set, the associated dataflows are not ... Unlike Apex or other code, the...
Read more >
Salesforce Change Sets – Limitations and The Deployment ...
Now that you're familiar with the basic concepts of creating and deploying Change Sets, it is important to be aware of common ChangeSet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found