Issues with NextJS ( Unity seems to export dependencies in the wrong place ). How do I fix this?

It doesnt look like that from the errors you posted

well it works if I run it with pure vite

by user 465420608906461195

w/out any change

by user 465420608906461195

exceptions are those 2 errors

by user 465420608906461195

fixed the import issue, thx

by user 465420608906461195

this persists now :frowning:

by user 465420608906461195

only on nextjs runtime, on vanilla vite it works fine

by user 465420608906461195

I think it has to do with the original issue where types weren’t found. The reason is that webpack does somehow produce/chunk two/multiple versions of Needle Engine. I’ll have to reproduce this and figure out why this happens in the first place

can you try changing this in your nextjs project:
(remove needle-engine import and only import the type in line 7)
image.png

tried, doesn’t work

by user 465420608906461195

added some logging, found this
image.png

by user 465420608906461195

Did you restart the next server as well?

yep

by user 465420608906461195

Ok, the error should be fixed in the next version

As far as I can tell the rest of the sample works fine

Let me know if the recent version fixed the issue for you

the AudioListener bug is fixed, but now it has problems with import the Network npmdefobj

by user 465420608906461195

removing and reimporting the folder doesn’t fix it

by user 465420608906461195

and it is imported in the package.json

by user 465420608906461195

Reverted to 3.12.1 and copied over the AudioListener file and everything works fine

by user 465420608906461195