Skip to content

Commit

Permalink
[v3] Fix TypeError: _jsx is not a function for remote content on deve…
Browse files Browse the repository at this point in the history
…lopment environment (#2629)

* aa

* use const

* fix tests, minify css vars
  • Loading branch information
Dimitri POSTOLOV authored Jan 15, 2024
1 parent 0271704 commit c74ae90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .changeset/old-bears-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'nextra': patch
---

Fix TypeError: \_jsx is not a function for remote content on development
environment
15 changes: 1 addition & 14 deletions packages/nextra-theme-docs/src/components/head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,7 @@ export function Head(): ReactElement {
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<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>
<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>
{head}
</NextHead>
)
Expand Down
2 changes: 2 additions & 0 deletions packages/nextra/src/server/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export async function compileMdx(
format,
outputFormat,
providerImportSource: 'nextra/mdx',
// Fix TypeError: _jsx is not a function for remote content
development: process.env.NODE_ENV === 'development',
remarkPlugins: [
...(remarkPlugins || []),
remarkMermaid, // should be before remarkRemoveImports because contains `import { Mermaid } from ...`
Expand Down

0 comments on commit c74ae90

Please sign in to comment.