No Aurelia APIs are defined for the element:

Total
0
Shares

Intro

So I am working on Aurelia for the first time, and received a project from the client.

Supposedly everything was working 1 month ago, but now I am getting an error.

No Aurelia APIs are defined for the element: "O-SCHEMA-ACTION".

The line that is causing the error is the following:

<o-schema-action show-as-popup.bind="false" repeat.for="a of actionGroup" 
item.bind="a" view-model.ref="this"></o-schema-action>

Does anyone have any idea what could be causing this?

There are to values in the array actionGroup.

Exception

aurelia-task-queue.js:56 Uncaught Error: No Aurelia APIs are defined for the element: "O-SCHEMA-ACTION".
    at getAU (aurelia-binding.js:5329)
    at Function.locateAPI (aurelia-binding.js:5356)
    at NameExpression.createBinding (aurelia-binding.js:5346)
    at applyInstructions (aurelia-templating.js:2467)
    at ViewFactory.create (aurelia-templating.js:2682)
    at BoundViewFactory.create (aurelia-templating.js:2562)
    at Repeat.addView (repeat.js:269)
    at ArrayRepeatStrategy._standardProcessInstanceChanged (array-repeat-strategy.js:111)
    at ArrayRepeatStrategy.instanceChanged (array-repeat-strategy.js:35)
    at Repeat.itemsChanged (repeat.js:160)

index.js:116 Uncaught Error: Uncaught Error: No Aurelia APIs are defined for the element: "O-SCHEMA-ACTION".
    at window.onerror (index.js:116)

HTML

<template>
    <c-page data-label.bind="action.groupLabel | humanize">
        <c-form>
            TESTING

            <o-form-schema action-controller.bind="actionController" root.bind="root" action.bind="action" filter-by="name !=='results'">

                <c-actions>
                    <li>
                        <button as-element="c-trigger" data-decorator="d-as-button t-error-dark-boxed" click.delegate="cancel()">CANCEL</button>
                    </li>

                    TODO: ISSUE HERE WITH BUTTONS
                    <o-schema-action show-as-popup.bind="false" repeat.for="a of actionGroup" item.bind="a" view-model.ref="this"></o-schema-action>

                </c-actions>

            </o-form-schema>

        </c-form>
    </c-page>
</template>

TypeScript / JS

export class Action {

     @bindable actionGroup = null;
   @bindable action = null;
        groupId = null;
        @bindable root = null;



    constructor() {}

    determineActivationStrategy() {
        return activationStrategy.invokeLifecycle;
        }

 cancel() {

    }

    activate(params, routeConfig) {
        this.groupId = params.id;
        Configuration.load().then(ret => {

            let clone = JSON.parse(JSON.stringify(ret));
            this.root = clone;
            this.actionGroup = this.buildGroup(clone.actions, this.groupId);
            this.action = this.actionGroup[0];
        });
    }

    buildGroup(actions, groupId) {
        let ret = actions.filter(a => CONDITION );
        ret.forEach(a => {
            // NOT RELEVANT TO SHOW THIS ( it works ) ... 
        });
        return ret;
    }


}

Solution

Initial Answer

I just noticed…

One month ago we had two files:

o-schema-action.js

AND

o-schema-action.html

These files seem to have been removed.

Update

I just had this again with a different error:

No Aurelia APIs are defined for the element: "AB-SELECTOR".

This error seems to be thrown when a file is missing for the specific element.

Leave a Reply

Your email address will not be published. Required fields are marked *