Skip to content

NextJS Port Not Forwarding in Codespaces Web #123935

Answered by RysanekDavid
sr5434 asked this question in Codespaces
Discussion options

You must be logged in to vote

Hey,

First check "package.json"

Should look like this:

"scripts": {
  "dev": "next dev"
}

Next make sure your Next.js configuration allows for connections from all interfaces

module.exports = {
  devIndicators: {
    autoPrerender: false,
  },
  serverRuntimeConfig: {
    host: '0.0.0.0',
  },
};

Also this modification in your package.json could help:

"scripts": {
  "dev": "next dev -p 3000 -H 0.0.0.0"
}

Let me know if that works, David.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sr5434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working correctly Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform,
2 participants