Hello, was just trying out Needle with NextJS for a personal project and I tried the First Person Multiplayer sample. All goes ok but the dependencies keep getting imported from the internal Needle server ( inside the Unity project files ) instead of being exported to my nextjs project and imported from there. Here is a picture of the error I am getting and one of my settings.
Original Post on Discord
by user 465420608906461195
forgot my NextJS package.json, here it is:
by user 465420608906461195
Hi, it looks like the import in the Cannon script is using a wrong import path
The package.json paths are all correct. Can you try removing the SampleScripts NpmDefObject in the ExportInfo component? Maybe it’s not actually needed
gives me a lot of error and the movement ( phyisical/camera ) isn’t working
by user 465420608906461195
fixes the import error tho
by user 465420608906461195
Can you show your ExportInfo component again?
I think only LookAtCamera might be missing (since it’s in SampleScripts) - the other components should be in FirstPersonController Npmdef
by user 465420608906461195
Does it work if you restart the server (ALT + click Start Server button) ?
nope, and the sample scripts are also back somehow
by user 465420608906461195
Ok one second I’ll try it here too
Ok I’m not 100% sure yet but seems like with webpack/next there’s currently an issue with registering the component types from referenced packages. I’ll try to investigate some more and push a fix as soon as possible (Got it working here now with some changes)
mind sharing the changes? ( a zip is more than fine, no need to explain them in detail unless I have to change needle code - even then a zip is fine, just a heads up abt the files changed pls :> )
by user 465420608906461195
Can you try updating to 3.12.1 ?
running it from unity keeps reverting me back to 3.12.0-beta.1
by user 465420608906461195
( just hitting play )
by user 465420608906461195
( ig I need to update the unity addon, but it I can’t find docs on how ) ( nvm, saw there is no new version for unity )
by user 465420608906461195
got it to work by manually updating the package.json during runtime, but it just spits errors ( the import issue is fixed tho )
by user 465420608906461195