Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "edge" as a runtime for pages in the Pages Router #65948

Closed

Conversation

joulev
Copy link
Contributor

@joulev joulev commented May 19, 2024

What?

Currently pages on the Pages Router only accept "experimental-edge", not "edge". If you use "edge", there will be a build error.

This is contrary to the documentation, which states

You can explicitly set the runtime on a per-page basis by modifying the config, for example:

// pages/index.js
export const config = {
  runtime: 'nodejs', // or "edge"
}
 
export const getServerSideProps = async () => {}

source

This PR allows "edge" to be used as the runtime for Pages Router pages.

Why?

Either the documentation is wrong, or the "edge" check should be removed. Since in #50701, the // or "edge" phrase was explicitly added to that part, I suppose the team decided already to fully stabilise the edge runtime everywhere, so I decided to make the PR to remove the "edge" check.

If the documentation is wrong and the edge runtime should still be marked as experimental, feel free to close this PR but please also update the documentation in that case.

How?

I simply removed the "edge" checks. Using "experimental-edge" in pages should now result in a warning but things should still work (same as Edge API Routes).

Fixes #65945

Signed-off-by: GitHub <noreply@github.com>
@ijjk
Copy link
Member

ijjk commented May 19, 2024

Allow CI Workflow Run

  • approve CI run for commit: 6ebdd91

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@ijjk
Copy link
Member

ijjk commented May 19, 2024

Allow CI Workflow Run

  • approve CI run for commit: 6ebdd91

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@leerob
Copy link
Member

leerob commented May 20, 2024

Thank you! Good flag. I would prefer to update the docs here to remove that bit. Pulling forward in #65962 🙏

@leerob leerob closed this May 20, 2024
@joulev
Copy link
Contributor Author

joulev commented May 20, 2024

Thank you!

leerob added a commit that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants