Starting with arkenv 0.9.0, an error occurs during build when trying to use arkenv in a Next.js client bundle. It seems that arkenv imports node:module, which causes errors when building the client bundle.
By default, Next.js does not allow environment variables to be referenced from the client bundle, but you can reference them by adding the NEXT_PUBLIC_ prefix, so in my project I was using code similar to the following:
const parsedEnv = arkenv(ClientEnvSchema, {
env: {
NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL
}
});
Is this a bug or intended behavior? If it is an intended behavior, are there any plans to make arkenv available in client bundles again? (Apologies if this was intended and was planned to be implemented in #655)
Starting with arkenv 0.9.0, an error occurs during build when trying to use arkenv in a Next.js client bundle. It seems that arkenv imports
node:module, which causes errors when building the client bundle.By default, Next.js does not allow environment variables to be referenced from the client bundle, but you can reference them by adding the
NEXT_PUBLIC_prefix, so in my project I was using code similar to the following:Is this a bug or intended behavior? If it is an intended behavior, are there any plans to make arkenv available in client bundles again? (Apologies if this was intended and was planned to be implemented in #655)