Skip to content

fix: enable JSX loader for .js files in esbuild ESM build - #89

Merged
HolimaX merged 1 commit into
feature/Add-ESI-Transifex-OKTAforPCD1.3from
chunk/fix-esbuild-jsx-loader-js-files
Sep 8, 2026
Merged

HolimaX merged 1 commit into
feature/Add-ESI-Transifex-OKTAforPCD1.3from
chunk/fix-esbuild-jsx-loader-js-files

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

Summary

  • The build:lib step failed because esbuild's ESM build couldn't parse JSX syntax in .js files
  • esbuild only enables JSX processing for .jsx files by default — the auth/navigation components (LoginForm.js, LoginPage.js, ProfilePage.js, RegistrationForm.js, Navigation.js) contain JSX but use the .js extension
  • Fix: add loader: { '.js': 'jsx' } to the buildEsm() esbuild config in scripts/build-lib.js, matching the behavior of the webpack CJS build which already handles this via @babel/preset-react

Test plan

  • Verify npm run build:lib completes without errors (both dist/cjs and dist/esm produced)
  • Verify npm run build-nix succeeds end-to-end in CI

https://app.circleci.com/agents/gh/HolimaX/chat/17b8f823-4022-4df4-8b71-bfd17121049e

esbuild only processes JSX in .jsx files by default. The auth and
navigation components (LoginForm.js, LoginPage.js, ProfilePage.js,
RegistrationForm.js, Navigation.js) use JSX but have .js extensions,
causing "The JSX syntax extension is not currently enabled" errors.

Add loader: { '.js': 'jsx' } to the buildEsm() esbuild config so .js
files are parsed as JSX, matching the existing webpack CJS build behavior.

AI-Generated: true
@HolimaX
HolimaX merged commit 302727f into feature/Add-ESI-Transifex-OKTAforPCD1.3 Sep 8, 2026
1 of 6 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.

1 participant