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

Fix: export jsx-dev-runtime in development mode #323

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

imtsuki
Copy link
Contributor

@imtsuki imtsuki commented Dec 22, 2022

From @mdx-js/mdx version 2.2.0 onwards, the compiled source uses jdxDEV from react/jsx-dev-runtime in development mode rather than jdx-runtime. This patch determines whether we should export jsx-dev-runtime by checking process.env.NODE_ENV. This environment variable should be always present in Next.js in both browser and server environment. @mdx-js/* are bumped to ^2.2.1 because this change is incompatible with version 2.1.5 or older.

Fixes TypeError: _jsxDEV is not a function error #307 (comment)

From `@mdx-js/mdx` version 2.2.0 onwards, the compiled source uses
`jdxDEV` from `react/jsx-dev-runtime` in development mode instead.
This patch determines whether we should export `jsx-dev-runtime`
by checking `process.env.NODE_ENV`. This environment variable is
always present in Next.js both in browser and server environment.
`@mdx-js/*` are bumped to `^2.2.1` because this change is incompatible
with version 2.1.5 or older.

Signed-off-by: imtsuki <me@qjx.app>
@hashicorp-cla
Copy link

hashicorp-cla commented Dec 22, 2022

CLA assistant check
All committers have signed the CLA.

@cseas
Copy link

cseas commented Jan 5, 2023

Please review @jescalan @BRKalow
This is a blocker for using next-mdx-remote with Next.js 13

Copy link
Contributor

@BRKalow BRKalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 💯

@BRKalow BRKalow merged commit 8b22fed into hashicorp:main Jan 5, 2023
@BRKalow
Copy link
Contributor

BRKalow commented Jan 5, 2023

I'll get this released tomorrow 👍

@BRKalow
Copy link
Contributor

BRKalow commented Jan 5, 2023

https://github.com/hashicorp/next-mdx-remote/releases/tag/v4.2.1

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

4 participants