Skip to content

Commit

Permalink
fix: React SSR Doesn't like the new JSX runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Feb 28, 2022
1 parent 6789637 commit 65bb1f1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function generateBabelLoader({
} catch (e) {
hasReactRefresh = false;
}
const hasJsxRuntime = react ? semver.gte(react.version, '16.14.0') : false;
const hasJsxRuntime =
react && !target?.includes?.('node')
? semver.gte(react.version, '16.14.0')
: false;
const cwd = path.resolve(process.cwd(), babelRoot);
const filename = path.join(cwd, 'noop.js');
const cacheIdentifier =
Expand Down

0 comments on commit 65bb1f1

Please sign in to comment.