Lance G
Lance G

Reputation: 144

Aurelia - ReferenceError: SelectValueObserver is not defined

Trying out Aurelia and having a problem doing a simple databind to a dropdown element. Anytime I enter a value.bind on a <select> tag I get this js error "SelectValueObserver is not defined" I downloaded their ES 2016 "kit" which should have the latest version of aurelia I assume. It appears to work fine on Plunker but not on VS 2013 or 2015.

welcome.js

import states from './state-list';

export class Welcome {
    heading = 'Welcome to Aurelia!';
    firstName = 'John';
    lastName = 'Doe';
    myStateArray = states;
   stateSelected = 'MA';

 get fullName() {
    return `${this.firstName} ${this.lastName}`;
 }

 submit() {
    alert(`Welcome, ${this.fullName}!`);
 }
}

and html looks like:

    <template>
        <section>
            <h2>${heading}</h2>

            <form submit.trigger="submit()">
                <div>
                    <label>First Name</label>
                    <input type="text" value.bind="firstName">
                </div>
                <div>
                    <label>Last Name</label>
                    <input type="text" value.bind="lastName">
                </div>
                <div>
                    <label>Full Name</label>
                    <p>${fullName}</p>
                </div>

                <p>Selected: ${stateSelected}</p>

                <input id="myState" value.bind="stateSelected" />

                <select value.bind="stateSelected" class="ui search dropdown">
                    <option value="">State</option>
                    <option value="${state.code}"
                            model.bind="state.code"
                            repeat.for="state of myStateArray">
                        ${state.name}
                    </option>
                </select>

                <button type="submit">Submit</button>

            </form>
        </section>
    </template>

And I get this JS error:

Unhandled promise rejection ReferenceError: SelectValueObserver is not defined(…)

Anyone else experiencing this?

Upvotes: 2

Views: 463

Answers (1)

Jeremy Danyow
Jeremy Danyow

Reputation: 26386

There was a bug in a recent release of aurelia-binding that caused the SelectValueObserver to not be included in the build. Run jspm install aurelia-binding to fix this issue.

Upvotes: 3

Related Questions