webarkit / ARnft

A small javascript library for WebAR with NFT
GNU Lesser General Public License v3.0
220 stars 54 forks source link

Uploading ARnft code to a server? #264

Closed Carln02 closed 2 years ago

Carln02 commented 2 years ago

Hello! I'm kind of new to the world of WebXR and WebGL. I tested out the examples you guys provided using the http-server package and everything worked perfectly. I tried implementing the code myself with my own images and 3D models and everything worked well when running through the http-server package. However, I tried to upload the code to a server and make it public but I get an error there. I uploaded the whole ARnft-master folder as is and tried to run one of your examples, but I get the following error:

d3e96641-b468-40e4-9176-dbc7d2f4db65:1 Error: Request failed with status code 404 at A.exports (d3e96641-b468-40e4-9176-dbc7d2f4db65:1:6264) at A.exports (d3e96641-b468-40e4-9176-dbc7d2f4db65:1:8668) at XMLHttpRequest.S (d3e96641-b468-40e4-9176-dbc7d2f4db65:1:925)

I get this same exact error when trying to run any hosted ARnft code. I also tried importing the scripts using githack (like you mentioned) and got the same results. Any idea what's the problem?

By the way, thank you for this cool library! It's been really fun playing around with image tracking :)

kalwalt commented 2 years ago

Hi @Carln02 you receive this error because the code can't load one of the reources ( the camera_para.dat or the nft markers) it is depends on the server, but consider that the worker need load the resources an absolute path. Can't help more (you didn't say which server or service are you using). For example with gh-pages you can encounter this kind of issue.

Carln02 commented 2 years ago

Hello! Sorry for the late reply. I used Vercel.com as a host and it works now!

kalwalt commented 2 years ago

Hello! Sorry for the late reply. I used Vercel.com as a host and it works now!

Super! What caused the issue?

Carln02 commented 2 years ago

I was using a host that does not support node.js… Didn’t even know what node.js was before trying to host the code😅