krsbx / mind-ar-ts

A complete rewrite of Mind AR JS in TS
MIT License
22 stars 6 forks source link

NextJS: import to use lib with 'mindar-image-aframe.prod.js' #120

Open Thiraphat-K opened 1 year ago

Thiraphat-K commented 1 year ago

Hello, I would like to know the reason why this issue occurred, which involves changing the HTML tag from to in Next.js @krsbx @demisquare @maubalzano image Please let me know. Thank you.

krsbx commented 1 year ago

@Thiraphat-K can you specify which version of Next.js are you using? And if you are using Next.js 13, I think by adding 'use client'; at the top of your file should fix this issue

Thiraphat-K commented 1 year ago

@krsbx Do you mean only the files that called the lib? that I'm using Next.js 13 and I tried adding 'use client;' only to that file, but the issue still persists.

krsbx commented 1 year ago

@Thiraphat-K well noted, will try to fix this issue while updating the package

sorry for the inconvenience

Thiraphat-K commented 1 year ago

@krsbx I apologize for the previous issue. It was my own mistake for not providing the correct .mind file path. However, I currently seem to encounter another problem, which is that I'm unsure about calling this library. I'm not sure if it's similar to calling the React JS.

kelokchan commented 1 year ago

How to fix this? I'm getting the same error

krsbx commented 1 year ago

@Thiraphat-K I'll re-write the entire library again within this week since I'll be focusing this package to be compatible with React/Next/Remix

@kelokchan base on what I found this issue happen mostly because of the hydration and such, so to fix it at the moment we can add a conditional rendering so we only going to show the AR component when the hydration is completed