Skip to content

Q. How to use it (page router next@14) #156

@sacru2red

Description

@sacru2red

"next": "^14.2.12",
"node": "20.17.0",

I am using page router
so editr _document.tsx

<Html>
...
<PublicEnvScript />
...
</Html>

and build project and deploy

local (build files) .env : NEXT_PUBLIC_FOO=foo
server machine (build files) .env : NEXT_PUBLIC_FOO=bar

browser console (window['__ENV']) result is NEXT_PUBLIC_FOO=foo

I want NEXT_PUBLIC_FOO=bar (using runtime's env file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions