aframe-react icon indicating copy to clipboard operation
aframe-react copied to clipboard

TypeError: url.split is not a function

Open mocon opened this issue 7 years ago • 5 comments

Hello. I'm seeing the following error right after install:

screen shot 2017-09-19 at 1 02 10 pm

Am I doing something wrong, or is this a bug? Thanks!

mocon avatar Sep 19 '17 20:09 mocon

yes same thing here what's wrong

import React, { Component } from 'react'
import { render } from 'react-dom'

import 'aframe'
import 'aframe-particle-system-component'
import { Entity, Scene } from 'aframe-react'

class App extends Component {
  render () {
    return (
      <Scene>
        <Entity geometry={{primitive: 'box'}} material={{color: 'red'}} position={{x: 0, y: 0, z: -5}}/>
        <Entity particle-system={{preset: 'snow'}}/>
        <Entity light={{type: 'point'}}/>
        <Entity gltf-model={{src: 'virtualcity.gltf'}}/>
        <Entity text={{value: 'Hello, WebVR!'}}/>
      </Scene>
    );
  }
}

Meteor.startup(function () {
  const app = document.getElementById('app')
  render(<App />, app)
})

crapthings avatar Sep 27 '17 07:09 crapthings

the error goes after i removed this line

    <Entity gltf-model={{ src: 'virtualcity.gltf' }}/>

crapthings avatar Sep 27 '17 07:09 crapthings

same here. But what if we need to load a glTF file?

ETZerK avatar Oct 02 '17 17:10 ETZerK

I think this is just a typo in the example code.

Removing the dictionary such that the gltf-model attribute is set to a URL string (instead of an object containing a src property) seems to work fine for me, e.g.

<Entity gltf-model={'virtualcity.gltf'}/>
<Entity gltf-model="virtualcity.gltf"/>

psigen avatar Nov 16 '17 03:11 psigen

Hi, wich version of Aframe are you using? I was having the same problem and this last answer from @psigen worked for loading the gltf asset without throwing directory parsing error, anyway my models are showing as empty entities.

I'm using   "dependencies": {
    "aframe": "^0.8.2",
    "aframe-react": "^4.4.0",
  }

l00f00 avatar Dec 11 '18 11:12 l00f00