Warning: The core schema has detected an unknown property `color` for the component or system `undefined` in Aframe + Vuejs. This issue was flagged within 10 milliseconds in

I am facing some challenges trying to integrate Aframe and vuejs seamlessly, as the console is displaying warning messages. It seems like Aframe is validating the attribute values before vue has a chance to modify them.

Warning messages

core:schema:warn Unknown property `color` for component/system `undefined`. +349ms 2aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +2ms aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +1ms aframe.js:327
core:schema:warn Unknown property `height` for component/system `undefined`. +1ms aframe.js:327
core:schema:warn Unknown property `color` for component/system `undefined`. +1s aframe.js:327

Below is the code snippet:

App.vue

<template>
    <a-scene>
        <test-component v-for="block in blocks" :color="block.color" :position="block.pos"></test-component>
        <a-box :color="color" height="4"></a-box>
        <a-entity position="0 0 10" camera look-controls></a-entity>
    </a-scene>
</template>

<script>
import TestComponent from './TestComponent.vue';
require('aframe');

export default {
    name: 'app',
    components:{
        TestComponent,
    },
    data(){
        return {
            color: 'green',
            blocks: [
                {color: 'red', pos: "1 0 0"},
                {color: 'orange', pos: "2 0 0"},
                {color: 'yellow', pos: "3 0 0"}
            ]
        }
    },
    mounted(){
        //test to see if a-frame updates properly
        let that = this;
        setTimeout(function(){
            that.blocks.push({color: 'lime', pos: "4 0 0"})
        }, 1000)
        setTimeout(function(){
            that.blocks[3].pos = "5 0 0"
        }, 2000)
    }
}
</script>

TestComponent.vue

<template lang="html">
    <a-box :color="color" :position="position"></a-box>
</template>

<script>
export default {
    props: ['color','position'],
}
</script>

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>aframetest</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="dist/build.js"></script>
  </body>
</html>

main.js

import Vue from 'vue'
import App from './App.vue'

new Vue({
  el: '#app',
  render: h => h(App)
})

Answer №1

Here's a more simplified version of the code that works:

Link to Working Code

The HTML structure:

<a-scene id="app">
  <test-component v-for="block in blocks" :color="block.color" :position="block.pos"></test-component>
  <a-entity position="0 0 10" camera look-controls></a-entity>
</a-scene>

The JavaScript implementation:

Vue.component('test-component', {
  props: ['color','position'],
  template: `<a-box :color="color" :position="position"></a-box>`
})
new Vue({
  el: '#app',
  data(){
    return {
      blocks: [
        {color: 'red', pos: "1 0 0"},
        {color: 'orange', pos: "2 0 0"},
        {color: 'yellow', pos: "3 0 0"}
      ]
    }
  },
  mounted(){
    setTimeout(() => { 
      this.blocks.push({color: 'lime', pos: "4 0 0"})
    }, 1000)
    setTimeout(() =>{
      this.blocks[3].pos = "5 0 0"
    }, 2000)
  }
}) 

Check out this small interactive demo I created using vue.js and aframe together:
Interactive Demo Link GitHub Repository Link

Answer №2

As I searched for a solution to the same problem, I stumbled upon an interesting demo on GitHub.

What had been eluding me was

Vue.config.ignoredElements = [
  'a-scene',
  'a-entity',
  'a-camera',
  'a-sphere'
]

Being relatively new to Vue, I wasn't aware of the existence of Vue.config.ignoredElements. After adding it to my main.js file and including all the necessary aframe elements, the issue was resolved.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Pattern matching to exclude specific characters

To enhance security measures, I am looking to restrict users from inputting the following characters: ~ " # % & * : < > ? / \ { | } . The key requirement is that all other characters should be permitted, while ensuring that only the sp ...

Ways to conceal components of an external widget on my site

I'm attempting to add a chat widget to my website and I'm looking to hide specific elements within the widget. The chat function is provided by Tidio, but I believe this applies to most widgets. My main goal is to conceal a button that minimize ...

What could be causing the directives module to not get properly incorporated into the Angular app module?

I am currently in the process of learning Angular and have come across some challenges with module resolution. In js/directives/directives.js, I have a directive scoped within a directives module: angular.module("directives").directive("selectList", funct ...

Having difficulty retrieving model values from the angular ui modal dialog

Being only on my second day in the world of Angular, I am trying to navigate around Angular UI and build my first modal dialog. The modal dialog displays properly, but I'm encountering an issue with using models within it. You can view my demo on Plun ...

The operation to set a nickname in Discord.js was unsuccessful due to insufficient permissions

Recently, I started using discord.js to create a simple bot. Whenever I try to change the nickname by calling message.member.setNickname("Another Nickname").then(console.log, console.log); I receive the following error message: { name: ' ...

Retrieving Browser URL using Node.js

Currently, I am trying to extract the browser URL from a user who has integrated my external JavaScript file into their website. The process involves them including the JS file, which triggers an Ajax call using jQuery to communicate with my Node server. ...

Next.js is constantly fetching data with React Query

Within my Next.js project, I incorporated a query client into a page component, utilizing getServerSideProps for server-side rendering. The structure of the page is as follows: const Index = ({ configData }) => { const { t } = useTranslation(); cons ...

AngularJS directive error: Incorrect function invoked

I have two similar scenarios where I need to apply validators for specific files, even though I am aware that this goes against the DRY principle. However, being new to AngularJS, I am still learning the ropes. module.js var $moduleExample = angular.modu ...

Vue.js: Issue with applying class binding while iterating over an object

I've been working with an object data that looks like this: object = { "2020092020-08-01":{ "value":"123", "id_number":"202009" }, "2020092020-09-01":{ "value& ...

Tips for passing a URL variable into an Ajax script to prefill a form input in a search field

I have a website with a search feature that dynamically queries a database as you type in the search field, similar to Google's search suggestions. This functionality is achieved through AJAX. As the results appear on the page while you enter your se ...

Include the await keyword within the .then block

I'm trying to execute an await after receiving a response in the .then callback of my code: const info = new getInfo(this.fetchDetails); info .retrieve() .then((res) => { const details = this.getLatestInfo(res, 'John'); }) .ca ...

Retrieving the selected value from a dropdown menu without having to click on a

I'm facing an issue with 2 dropdown menus outside of an HTML table that is generated by PHP code. There's a submit button within this table, and here's how it's set up: <!doctype html> Select Year: ...

What is the best way to implement a response.write function within the request module?

I have a project where I am setting up an HTTP server and sending a request to the Yahoo Finance website to retrieve some data. My goal is to display this data on the browser, but I'm facing an issue with the response.write function not working inside ...

Issue with updating bound property correctly when dynamically generating components using v-for in Vue.js

Encountered a challenge with vue.js and seeking guidance on the best approach to address it. Here's a concise summary of the issue: Situation Data is fetched from a rest API, handled by a class called DataLoader using javascript prototype syntax. Th ...

Is it feasible to invert the order of arguments in async.apply?

According to the async documentation: apply(function, arguments..) Creates a function continuation with certain arguments already applied. This can be useful when combined with other control flow functions. Any additional arguments passed to the returned ...

Verify the login status, display a prompt if the user is not logged in, and proceed with the process upon successful

Utilizing Vuejs along with Vuetify and Vuex, I aim to develop a basic app such as a small todo list. My backend is supported by an Express REST api and for handling HTTP methods, I rely on Axios. In dealing with session management, I have come across two ...

IE8 encountering issues with Jquery ajax() request

My current issue involves submitting data using ajax from forms with a class of ajax. This functionality works flawlessly in Firefox, Safari, and Chrome, but is unsuccessful in Internet Explorer. ajax: function() { $('form.ajax').live(&apo ...

Guide on creating an autonomous select-all checkbox to show table columns

How can I create checkboxes with a "Select all" option and the following functionality: Check one or more checkboxes to show specific table columns. Uncheck them to hide the columns (toggle). Select the "Select all" checkbox to display all table columns. ...

Achieving a Subset Using Functional Programming

Looking for suggestions on implementing a function that takes an array A containing n elements and a number k as input. The function should return an array consisting of all subsets of size k from A, with each subset represented as an array. Please define ...