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

No longer works on Next.js 14 page router after v3.2.2 #132

Open
stuible opened this issue May 16, 2024 · 6 comments
Open

No longer works on Next.js 14 page router after v3.2.2 #132

stuible opened this issue May 16, 2024 · 6 comments

Comments

@stuible
Copy link

stuible commented May 16, 2024

After upgrading from 3.2.1 to 3.2.2, next-runtime-env no longer appears to work with Next.js 14 when using the page router as it did previously. Is this configuration no longer supported?

@stuible stuible changed the title No longer works on Next.js 14 Page router after v3.2.2 No longer works on Next.js 14 page router after v3.2.2 May 16, 2024
@davevanhoorn
Copy link
Contributor

Hi @stuible, please check the version guide in the docs. We're supporting the pages router in 1.x:

🔖 Version Guide

    1.x: Next.js 12/13 Page Router
    2.x: Next.js 13 App Router
    3.x: Next.js 14 with advanced caching

If you're using the app router and it doesn't work as expected, let me know ✌️

@stuible
Copy link
Author

stuible commented May 23, 2024

Hey thanks for replying! I reviewed those docs but was confused because there is no mention of Next 14 compatibility for 1.x, and no mention of Page router incompatibility for 3.x. Because of this, I opted to use version 3.x and can confirm that it did work for the page router up until 3.2.2 . Was this just a fluke?

@LoiLock
Copy link

LoiLock commented Jul 16, 2024

What about projects that use both the app and pages router? This is a supported use-case in Nextjs

@fezhengjin
Copy link

I encountered the same issue in the page router, and then I downgraded next-runtime-env to version 3.2.1, and it started working.

@agustingabiola
Copy link

I encountered the same issue in the page router, and then I downgraded next-runtime-env to version 3.2.1, and it started working.

You might need to add this: https://github.com/expatfile/next-runtime-env/pull/127/files for it to work. I had an issue with next 14.2.5 and version 3.2.2 so had to revert and couldn't test the pipeline again with this change but seems like a possible solution.

@stuible
Copy link
Author

stuible commented Aug 13, 2024

I encountered the same issue in the page router, and then I downgraded next-runtime-env to version 3.2.1, and it started working.

You might need to add this: https://github.com/expatfile/next-runtime-env/pull/127/files for it to work. I had an issue with next 14.2.5 and version 3.2.2 so had to revert and couldn't test the pipeline again with this change but seems like a possible solution.

That was a good lead @agustingabiola, however it does not seem to solve the issue (for me at least) while on Next 14's page router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants