Are there any resources for exporting to NextJS 13+ (with the app directory)

I tried following the Next sample, but Iā€™m getting pretty confused with an error :sweat_smile:

Original Post on Discord

by user 175371960413323264

bump

by user 175371960413323264

Hi, have you tried renaming your script to tsx ?

the scripts generated by needle?

by user 175371960413323264

i usually use nextJS with the app directory, and without typescript

by user 175371960413323264

We dont generate typescript/javascript scripts. What do you mean?

Can you share an example? You can modify the script location with the needle.config.json for component gen if you use that (although i think it wont generate them for tsx files, we would have to add that file type to the watcher)

Iā€™m quite confused overall, but what Iā€™m trying to add a scene to an already existing NextJS 13.4 project (with app directory)

by user 175371960413323264

The scene is using the hotspot manager from the samples

by user 175371960413323264

Iā€™ve just tried to reproduce this with adding a script to the next template - that works and Iā€™m not getting the error from above. Can you share more information about your project or perhaps send a repo?

I can send a repo later today. Not quite sure what other info I can share

by user 175371960413323264

Part of the issue is, I dont know how to setup needle with a nextjs project

by user 175371960413323264

You mean with an existing project? Does the nextjs sample itself not work for you when you run it yourself?

Yes, an exisiting NextJS 13.4 project, with the app directory and using JS instead of TS

by user 175371960413323264

What happens when you pick your existing project in Unity in the ExportInfo component?

You mean change the project folder to the one with my NextJS project?
image.png

by user 175371960413323264

Yes

And then use the needle.config.json in the project to change where assets are put. You can find info about options in the docs

by user 175371960413323264

Thanks, thats a known warning. It should still run on your configured port, does it?

image.png

by user 175371960413323264