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

[Hotfix/v1.0.2] mdxOptions > development : 환경에 따라 가변 설정 시도 #3

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

Orchemi
Copy link
Owner

@Orchemi Orchemi commented Mar 22, 2024

Trouble Shooting

mdx.lib.ts의 serialize 함수의 mdxOptions에서 development를 설정해주는데,

이를 true로 설정하면 개발 환경(development)에서는 문제가 발생하지 않고 serialize가 정상 동작하지만,
production에 배포했을 때, development가 아니므로 TypeError: _jsxDEV is not a function 에러 발생

하지만 development를 false로 설정하면, 개발환경에서 serialize가 정상동작하지 않고 TypeError: _jsx is not a function 에러 발생

-> 환경을 확인해 development를 가변적으로 설정하여 각 환경에서 모두 만족하도록 설정 시도

export const serializeMdx = async (
  source: string
): Promise<MDXRemoteSerializeResult> => {
  return await serialize(source, {
    mdxOptions: {
      development: ENV_TYPE === ENV.DV, // ⚠️
      ...
    },
  });
};

references

Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
huns-log ✅ Ready (Inspect) Visit Preview Mar 22, 2024 3:42pm

@Orchemi Orchemi merged commit 8f56075 into master Mar 22, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

1 participant