Replies: 2 comments
-
I'm also wondering about this :) We are currently using next 14 with pages router and with publicRuntime/serverRuntime. We want to start using the app router and incrementally migrate route for route to app router. Is is possible to use this lib both in pages router and app router at the same time during migration? |
Beta Was this translation helpful? Give feedback.
-
Ended up writing our own solution that works in pages and app router.
Usage in layout (or _document). Initialising the solution.
Usage of publicEnv in a component (do the same for serverEnv).
|
Beta Was this translation helpful? Give feedback.
-
We are migrating our app to app router, but many pages are still using pages router. Is there any way of using
next-runtime-env
for both app and pages routers. I haven't been able to make it work. All accesses through env("NEXT_PUBLIC_MY_VAR") come as undefined. I even tried to install v1 and v3 with yarn resolutions and I still get undefined for all variables, please help🙏Beta Was this translation helpful? Give feedback.
All reactions