AR.js icon indicating copy to clipboard operation
AR.js copied to clipboard

Incompatibility with Aframe 1.3.0 (most recent release)

Open vasturiano opened this issue 3 years ago • 5 comments

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

When importing AR.js in combination with the latest version of Aframe - 1.3.0 (released a few days ago), the module throws two errors in the console and fails to load any items onto the AR scene.

The errors are:

Uncaught TypeError: arContext.addEventListener is not a function
    at new ARjs.Session (aframe-ar.js:4041:12)
    at HTMLElement.<anonymous> (aframe-ar.js:7365:48)
    at HTMLElement.<anonymous> (aframe.min.js:45177:2943)
    at HTMLElement.<anonymous> (aframe.min.js:45187:12532)
    at HTMLElement.<anonymous> (aframe.min.js:45177:2943)
    at aframe.min.js:45177:1550

and

Uncaught TypeError: _this.dispatchEvent is not a function
    at done (aframe-ar.js:2527:15)
    at ARCameraParam.onload (aframe-ar.js:2679:9)
    at aframe-ar.js:1377:10
    at writeCallback (aframe-ar.js:1576:18)
    at writeByteArrayToFS (aframe-ar.js:1602:3)
    at XMLHttpRequest.oReq.onload (aframe-ar.js:1619:4)

If the current behavior is a bug, please provide the steps to reproduce.

I've made a codepen that shows the issue: https://codepen.io/vasturiano/pen/NWwdwxG

Essentially it's just importing [email protected], AR.js and adding an a-scene tag to the body.

<head>
  <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
  <script src="https://raw.githack.com/AR-js-org/AR.js/3.3.3/aframe/build/aframe-ar.js"></script>
</head>

<body>
  <a-scene></a-scene>
</body>

Please mention other relevant information such as the browser version, Operating System and Device Name

What is the expected behavior?

Is there something that can be done externally to have AR.js work with Aframe 1.3.0?

If this is a feature request, what is motivation or use case for changing the behavior?

vasturiano avatar Feb 07 '22 23:02 vasturiano

Hi @vasturiano have you tested the master or dev branch?

kalwalt avatar Feb 08 '22 11:02 kalwalt

@kalwalt the example is importing v3.3.3, the latest version of AR.js. I believe that's the same as master.

vasturiano avatar Feb 08 '22 14:02 vasturiano

@vasturiano can you try with the dev branch? I applied some changes related to new Three.js that should probably apply to aframe.

kalwalt avatar Feb 08 '22 17:02 kalwalt

@kalwalt I've just tested with the dev branch and it works just fine, so that's great! Is there plans sometime soon to merge it to master and release a new version with these fixes?

Also just a side question, any specific reason why the recent versions haven't been published to the npm registry? Looks like the latest published version there was 2.2.2, about 2y ago. https://www.npmjs.com/package/ar.js

vasturiano avatar Feb 08 '22 20:02 vasturiano

@vasturiano that is not our official npm registry, you should go instead to https://www.npmjs.com/package/@ar-js-org/ar.js Consider that is an experimental package until will be merged in the master branch, in fact at the moment the aframe version has some issues.

kalwalt avatar Feb 08 '22 21:02 kalwalt

This issue was solved with release https://github.com/AR-js-org/AR.js/releases/tag/3.4.5 see aframe version https://github.com/AR-js-org/AR.js/blob/35ea5555cd8d5b6c6aca0180cd28728e98a17203/package.json#L63

kalwalt avatar Apr 18 '23 17:04 kalwalt