Skip to content

Commit c74ae90

Browse files
author
Dimitri POSTOLOV
authoredJan 15, 2024
[v3] Fix TypeError: _jsx is not a function for remote content on development environment (#2629)
* aa * use const * fix tests, minify css vars
1 parent 0271704 commit c74ae90

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed
 

‎.changeset/old-bears-invent.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'nextra': patch
3+
---
4+
5+
Fix TypeError: \_jsx is not a function for remote content on development
6+
environment

‎packages/nextra-theme-docs/src/components/head.tsx

+1-14
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,7 @@ export function Head(): ReactElement {
5454
name="viewport"
5555
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
5656
/>
57-
<style>{`
58-
:root {
59-
--nextra-primary-hue: ${lightHue}deg;
60-
--nextra-primary-saturation: ${lightSaturation}%;
61-
--nextra-navbar-height: 4rem;
62-
--nextra-menu-height: 3.75rem;
63-
--nextra-banner-height: 2.5rem;
64-
}
65-
66-
.dark {
67-
--nextra-primary-hue: ${darkHue}deg;
68-
--nextra-primary-saturation: ${darkSaturation}%;
69-
}
70-
`}</style>
57+
<style>{`:root{--nextra-primary-hue:${lightHue}deg;--nextra-primary-saturation:${lightSaturation}%;--nextra-navbar-height:4rem;--nextra-menu-height:3.75rem;--nextra-banner-height:2.5rem;}.dark{--nextra-primary-hue:${darkHue}deg;--nextra-primary-saturation:${darkSaturation}%;}`}</style>
7158
{head}
7259
</NextHead>
7360
)

‎packages/nextra/src/server/compile.ts

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ export async function compileMdx(
215215
format,
216216
outputFormat,
217217
providerImportSource: 'nextra/mdx',
218+
// Fix TypeError: _jsx is not a function for remote content
219+
development: process.env.NODE_ENV === 'development',
218220
remarkPlugins: [
219221
...(remarkPlugins || []),
220222
remarkMermaid, // should be before remarkRemoveImports because contains `import { Mermaid } from ...`

0 commit comments

Comments
 (0)
Please sign in to comment.