question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

importing Aframe breaks build

See original GitHub issue

using the latest dist at https://github.com/aframevr/aframe/tree/master/dist

whenever I try to use es6 modules to import aframe:

import './aframe.min.js'

I get this error:

aframe.min.js:19685 Uncaught TypeError: systems[name] is not a constructor at HTMLElement.value (aframe.min.js:19685) at HTMLElement.value (aframe.min.js:19670) at HTMLElement.value (aframe.min.js:19603) at HTMLElement.wrappedMethod (aframe.min.js:18416) at module.exports.registerElement (aframe.min.js:18325) at Object.104.../../lib/three (aframe.min.js:19538) at o (aframe.min.js:1) at aframe.min.js:1 at Object.147.../package (aframe.min.js:22136) at o (aframe.min.js:1)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
mattrossmancommented, May 29, 2020

Scripts that have type="module" are automatically assigned the defer property, so they will essentially run at the end of <body>. However, A-Frame requires that the script is included before the body/scene.

I’m not sure why this is the case, as according to this, “the script that registers [custom components] has to be loaded after the DOM is parsed”.

Related: #4242.

0reactions
Type1Jcommented, Aug 18, 2022

(A script tag with type=“module” implies defer, as @mattrossman pointed out above.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

A-Frame .obj model displaying but broken - Stack Overflow
I've set up an example on Glitch if that makes things easier. Your exported obj file has a broken format for WebGL! During...
Read more >
A-Frame WebVR Tutorial 9 - Model Loading - YouTube
Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top...
Read more >
A-Frame v1.0.0 - WebXR Support, AR Mode
#aframe in WebAR apps, please import latest ; #aframe, v1.0.0 has been shipped ; @aframevr team for the great work. It's outstanding.
Read more >
Frames and Groups - Figma Help Center
To make a frame, choose the Frame Tool F and drag out an area of the screen, or use: macOS: Command-Option-G; Windows: Control...
Read more >
Part 2: Use and Style React Components - Gatsby
Import and use a pre-built component from another package. Create your own reusable “building block” component. Use component props to change the way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found