Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
El código js con type="module" no funciona en mi entorno vr

Trabajo en un entorno de realidad virtual codificando con A-FRAME, uso https://github.com/supermedium/superframe/tree/master/components/log/ para imprimir registros en el entorno de realidad virtual.

 <head> <title>My A-Frame Scene</title> <script src="https://aframe.io/releases/0.9.0/aframe.min.js"></script> <script src="https://unpkg.com/aframe-log-component/dist/aframe-log-component.min.js"></script> <script type="module" src="./f1.js"></script> <script type="module" src="./f2.js"></script> </head> <body> <a-scene id='main_scene'> <a-entity log="channel:c1" geometry="primitive: plane" material="color: #111" text="color: lightgreen" position="0 0 -4"></a-entity> </a-scene> </body>

Y en mi js tengo esto:

 //f1.js import foo from 'f2.js' function f(ts){ //... $('#main_scene').append('<a-entity obj'+ts.name+'></a-entity>'); AFRAME.registerComponent( 'obj'+ts.name, { init:function(){ var el = this.el; el.setAttribute("geometry","primitive:box;depth:"+0.01+";height:"+0.06+";width:"+0.04); el.setAttribute('color',"#027523"); el.setAttribute('position',{x:ts.x,y:ts.y,z:ts.z}); el.setAttribute('rotation',{x:0,y:ts.orientation,z:0}); }, tick: function(){ foo(); }, } ); //... } //f2.js function foo(){ AFRAME.log("hello",'c1') } export default foo

En los navegadores firefox si no uso vr Funciona, pero con gafas vr no funciona. En vr, el objeto no se crea. Cuando no uso type="module" y estoy codificando en un solo script, funciona (el problema no es con los registros sino con los objetos que no se "crean")

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!