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

Using an array to set the center of a map - Google Maps API

I'm attempting to populate a HTML menu with values from a JavaScript multidimensional array using setCenter. Example of HTML Menu <li><a onclick="map.setCenter(cityList[0][1], cityList[0][2]); return false"><script>document.write( ...

Create a custom chrome browser extension designed specifically for sharing posts on

I'm working on creating a basic chrome extension that features an icon. When the icon is clicked, I want the official Twitter window to pop up (similar to what you see here). One common issue with existing extensions is that the Twitter window remains ...

Trouble with selecting inputs within a Div Element

Could you please review the code below and help me understand why I am unable to retrieve the ID of the selected radio buttons using this.id? <div id="pay" class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"> < ...

Sending the results from a Vue.js component to a text input field in HTML

Using vue.js and the v-for function to read QR codes has been a challenge for me. For example: <ul v-for="(scan,key) in scans" :key="key" > {{scan.content}} </ul> I need to extract the value inside {{scan.content}}, like an EmployeeID, but I ...

Tips for maintaining the persistent state of tabs in a React.js application

I have created dynamic tabs using an array list, including nested tabs within those tabs. You can view the live sandbox link here: For the sandbox code and preview, visit: https://codesandbox.io/s/black-glade-phs69 The setup consists of 3 main tabs ...

I'm a complete programming newbie and I want to start learning JavaScript, jQuery, and other programming languages. Where should I

Coming from a design background with zero programming knowledge, I have recently learned XHTML and CSS. Now, I am eager to expand my skills by mastering JavaScript, jQuery, and more. Where should I begin? This will be my first foray into programming. Whil ...

Angular data binding between an input element and a span element

What is the best way to connect input texts with the innerHTML of a span in Angular6? Typescript file ... finance_fullname: string; ... Template file <input type="text" id="finance_fullname" [(ngModel)]="finance_fullname"> <span class="fullnam ...

Could someone please explain why my ajax is not functioning properly?

I have been working on an AJAX function to pass input values from one page to another. However, I am facing a challenge where the value is not being passed as expected after redirection. Despite my efforts, I cannot figure out why it's not functionin ...

A guide to displaying the date retrieved from a JSON data file API request using JavaScript

How can I display the date from a JSON data file API call using JavaScript? I am facing difficulty in showing the date on the dashboard display page. I am utilizing JavaScript with async-await for calling the API, and Bootstrap 4 for design. The function ...

Is there a way to retrieve the objects generated by DirectionsRenderer on Google Maps V3?

Is there a simple method to access the objects and properties of the markers and infowindows that are generated by the DirectionsRenderer? (such as the "A" and "B" endpoints of the route) I want to swap out the infowindows for the "A" & "B" markers wi ...

Modifying HTML elements with JavaScript - a practical guide

I'm trying to dynamically add the variable x to an existing HTML tag. The goal is to update the image tag <img id="Img" src="IMG/.jpg"/> by appending the variable x at the end of its id and source: <script> var images ...

When Firebase authentication signs out users who were previously authenticated, it results in them facing permission denied errors

1) User A visits my website, and A is successfully authenticated and can write to the firebase database through the web browser. 2) User B then visits my site, and after being authenticated, they are able to write to the firebase database via the browser. ...

How can I execute a function when ng-click is triggered on an <a> tag, and ensure it opens in a new tab?

I am facing an issue with an element in my code, which is as follows: <a ng-click="vm.openPage(page)">{{page.pageId}}</a> Within the vm.openPage() function, there are validations that need to be performed before redirecting to the page refere ...

Tips for incorporating additional filter criteria into a jquery script

I am currently utilizing a jQuery script to filter data based on date periods. However, I now need to include an additional filtering criteria for the "POSITION" column. Since I lack expertise in jQuery, I would rather accomplish this using plain vanilla J ...

Utilize JavaScript to Replace KeyPress Event on Input Field

While attempting to substitute the key press of "K" with "Z" in an input field, I managed to accomplish it successfully. However, there seems to be a slight delay that causes the user to observe the transition from "K" to "Z". Below is the code that I use ...

Ensure that the div automatically scrolls to the bottom when it is loaded, and also when new data is added - using angular

My goal is to replicate the functionality of the iPhone's "Messages" app on a web application using AngularJS or any other JavaScript framework. Each message will be contained in a div element within a larger container. When a new message is added, I ...

Navigating Cross-Origin Resource Sharing (CORS) Challenges within

Currently in the process of developing an API utilizing our API server script and attempting to establish communication with the API on the IONIC framework application. Progress is being made, however, encountering a recurring issue with the cross-origin b ...

Encountering an issue with locating an argument in a JSON file

My JSON file seems to have an error, and I'm not sure where the issue lies within my data blocks. I attempted using jsonpathfinder for reading but encountered a syntax error. { "data": [ { "gender": "male" } ] }{ "data": [ { ...

Guide on attaching an onclick event to a button created with a string in Next.js?

<div onClick={(event) => this.addToCart(event)}> <ReactMarkdownWithHtml children={this.props.customButton} allowDangerousHtml /> </div> In my current situation, I am facing an issue with the code above. The button is being rendered ...

What is the best method for accessing the service response data when I am sending back an array of custom map with a promise as an object?

Sharing my code snippet below: function createObject(title, array){ this.title = title; this.array = array; } //$scope.objects is an array of objects function mapPromise(title, promise){ this.title= title; this.promise = promise; }; var fet ...