supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

TypeError: url.split is not a function #106

Open mocon opened 7 years ago

mocon commented 7 years ago

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!

crapthings commented 7 years ago

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 commented 7 years ago

the error goes after i removed this line

    <Entity gltf-model={{ src: 'virtualcity.gltf' }}/>
ETZerK commented 7 years ago

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

psigen commented 7 years ago

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"/>
l00f00 commented 5 years ago

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",
  }