Open rama142694 opened 1 year ago
trying several times i achieve to know a little bit more of where the problem is and it has something to do with the next js new app folder for routing. With the pages folder it works correct
trying several times i achieve to know a little bit more of where the problem is and it has something to do with the next js new app folder for routing. With the pages folder it works correct
Do you have an example of how you implemented this in nextJs with pages structure
I am getting following error for the same
TypeError: (0 , react_unity_webgl__WEBPACK_IMPORTED_MODULE_2__.useUnityContext) is not a function
This error happened while generating the page. Any console logs will be displayed in the terminal window.
trying several times i achieve to know a little bit more of where the problem is and it has something to do with the next js new app folder for routing. With the pages folder it works correct
Do you have an example of how you implemented this in nextJs with pages structure
I am getting following error for the same
TypeError: (0 , react_unity_webgl__WEBPACK_IMPORTED_MODULE_2__.useUnityContext) is not a function This error happened while generating the page. Any console logs will be displayed in the terminal window.
Yes, here is the folder structure:
and here is the implementation on the index page:
Hey, I got this same issue. I believe it has to do with "By default, components inside app are React Server Components." which is a new part of NextJS 13. I was able to fix it by converting the component which included my Unity component to a client component by adding the 'use client'
directive at the top of the file. https://nextjs.org/docs/getting-started/react-essentials#client-components
hey! im using nextjs with typescript and im having this problem
i try to re make the project like in this another issue but it doesnt work.
Here is my code
![image](https://github.com/jeffreylanters/react-unity-webgl/assets/50003905/8fc134f2-e21b-4304-8c6c-df5b03e6e6c3)
and my folder structure![image](https://github.com/jeffreylanters/react-unity-webgl/assets/50003905/254227ee-ad67-4922-83a2-1ddefefb58ca)
Originally posted by @rama142694 in https://github.com/jeffreylanters/react-unity-webgl/discussions/488#discussioncomment-5956240