NextJs 4.22 application not launching correctly

I have this app which is running in NextJs 4.22 . It launches sometimes but most of the times it doesn’t launch as expected when I run it through Replit console button. Anyone else facing similar issues ?

$ npm list next
my-app@0.1.0 /home/runner/ProjectName
├─┬ next-auth@4.22.1
│ └── next@13.4.7 deduped
└── next@13.4.7

Adding logs as comments I am not able to edit the post:

 npm run dev

> my-app@0.1.0 dev
> next dev --hostname 0.0.0.0

(node:3059) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
(node:3070) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
- event compiled client and server successfully in 356 ms (18 modules)
- wait compiling...
- event compiled client and server successfully in 167 ms (18 modules)

Hi @KiranVadakkath thanks for your post and welcome to the community!

Could you please provide some more information? If possible a link to the Repl you are working on would help as it would let others in the community suggest some ideas.

1 Like

Thank you @IanAtCSTeach . The repl I am working with is private : https://replit.com/@KiranVadakkath/AITherapist . let me know if you want me to mark it as public for debugging.

Create the same app with stock nextjs template (next@13.4.9) of replit and it worked. If you upgrade the next js version of a project then run won’t work, i think it is a bug.

Thanks @KiranVadakkath I’ve moved your topic into Bug Reports to see if anyone can investigate this further.

Hey @KiranVadakkath!

We aren’t able to reproduce this issue. How are you upgrading the NextJS version in the newly created project? Could you create a NextJS Repl and configure it to reproduce the issue, then send it to us so we can investigate?

2 Likes

Hi Shane, I experienced the same issue.

I have a public repl here
https://replit.com/@0xKofi/base-template?v=1

It runs fine now on NextJS12. If I uninstall NextJS12 and install NextJS13 using npm then it fails to run.

The logs I get when the NextJS13 fails to run look the same as Kiran’s. It just hangs there and then I get the “Hmm… We couldn’t reach this Repl” message

1 Like

Thanks for the information. We will take another look into this issue.

I was able to reproduce this and have sent this to the team. I will follow up once I have an update.

This has been fixed in the official template: https://replit.com/@replit/Nextjs

You can use that template or add

[[ports]]
localPort = 3000
externalPort = 80

to .replit in your template.

The problem was that the new version of Next.js opens more ports, which broke the automatic port detection that the Web View uses.

4 Likes

Thank you @ryantmreplit . Adding the ports snippet to template file solved the issue.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.