Skip to content
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

[v2]"Troubleshooting: 'Could not find value for interface' Error When Outputting Pre-defined Interface to Another Node" #313

Closed
erwanito12 opened this issue Aug 6, 2023 · 1 comment
Labels
bug Something isn't working v2 Related to Baklava v2
Projects

Comments

@erwanito12
Copy link

erwanito12 commented Aug 6, 2023

when I want to output a Pre-defined interface or a personal Display Component to another node, I get an error: Could not find value for interface

import ReactiveOutputTest from "./ReactiveOutputTest.vue";
import { TextInputInterface } from "baklavajs";

class ReactiveOutputTestInterface extends NodeInterface<number> {
    constructor(name: string, value: number) {
        super(name, value);
        this.setComponent(markRaw(ReactiveOutputTest));
    }
}

export default defineNode({
    type: "ReactiveOutputTest",
    inputs: {
        a: () => new ReactiveOutputTestInterface("Test", 3),
    },
    outputs: {
        b: () => new TextInputInterface("Name", "Edit me"),
    },
});

ReactiveOutputTest.vue:

<template>
    <button @click="add" >{{ modelValue }} </button>
</template>

<script>
import { defineComponent } from "vue";

export default defineComponent({
    props: {
        modelValue: {
            type: Number,
            // readonly: false,
            required: true,
        },
    },
    emits: ["update:modelValue"],
    setup(props, { emit }) {
        const add = () => {
            console.log('modelValue', props.modelValue);
            console.log('modelValue', props);
            emit("update:modelValue", props.modelValue + 1);
            console.log('modelValue+1', props.modelValue);
        };
        return { add };
    },
});
</script>

image
image

@newcat newcat added bug Something isn't working v2 Related to Baklava v2 labels Nov 1, 2023
@newcat
Copy link
Owner

newcat commented Nov 1, 2023

Thanks, will be fixed in the next release

@newcat newcat added this to Done but not released in V2 Nov 1, 2023
@newcat newcat moved this from Done but not released to Done in V2 Nov 2, 2023
@newcat newcat closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Related to Baklava v2
Projects
Status: Done
V2
  
Done
Development

No branches or pull requests

2 participants