You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some import.meta.env in MDX's code blocks and don't want them to be converted. (Just display import.meta.env.XXXXX)
In dev environment, the output is doing well.
However, import.meta.env.SITE becomes undefined (or the url I defined in astro.config.mjs); import.meta.env.PUBLIC_HOSTNAME becomes (Object.assign(import.meta.env,{HOSTNAME:process.env.HOSTNAME,})).PUBLIC_HOSTNAME in production.
Thanks for reporting @ymcheung! Looks like we're missing our environment variable handling in MDX that we use for standard Markdown. Will PR that fix 👍
What version of
astro
are you using?1.1.1
Are you using an SSR adapter? If so, which one?
Deno Deploy
What package manager are you using?
pnpm
What operating system are you using?
macOS 12
Describe the Bug
I have some
import.meta.env
in MDX's code blocks and don't want them to be converted. (Just display import.meta.env.XXXXX)In dev environment, the output is doing well.
However,
import.meta.env.SITE
becomesundefined
(or the url I defined inastro.config.mjs
);import.meta.env.PUBLIC_HOSTNAME
becomes(Object.assign(import.meta.env,{HOSTNAME:process.env.HOSTNAME,})).PUBLIC_HOSTNAME
in production.Link to Minimal Reproducible Example
https://codesandbox.io/s/vibrant-chandrasekhar-gbicwd?file=/src/pages/article1.mdx
Participation
The text was updated successfully, but these errors were encountered: