fix: pin @babel/standalone to 7.23.10 to restore app rendering - #1
Open
arthurtabbal wants to merge 2 commits into
Open
fix: pin @babel/standalone to 7.23.10 to restore app rendering#1arthurtabbal wants to merge 2 commits into
arthurtabbal wants to merge 2 commits into
Conversation
Versions newer than 7.23.10 changed default output to ESM, generating import statements that crash when injected as a plain <script> tag. Also adds data-presets="react" to scope Babel to JSX-only transforms. Tech debt: in-browser Babel transpilation should be replaced with a proper build step (Vite/esbuild) to eliminate this fragility and improve load performance (~1MB Babel bundle).
marceloarocha
requested changes
Jun 23, 2026
marceloarocha
left a comment
There was a problem hiding this comment.
Pode aproveitar pra fixar as dependencias no package.json e adicionar o sfw no CI ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
Versões recentes do
@babel/standalone(pós 7.23.x) mudaram o output padrão para ESM, gerandoimportstatements no código transpilado. Como o script é injetado como<script>comum (não-módulo), o browser rejeita com:Isso quebrava a app completamente — tela em branco tanto no GitHub Pages quanto localmente.
Fix
@babel/standalonena versão7.23.10, última antes da mudança de comportamentodata-presets="react"no script tag para escopar o Babel só à transformação de JSX, sem transforms de módulosTech debt
Esta correção é um paliativo. O uso de Babel in-browser tem limitações conhecidas:
babel.min.jsem cada carregamentoRecomendação de longo prazo: migrar para um build step com Vite ou esbuild, compilando o JSX uma única vez no CI/CD antes do deploy. O GitHub Actions já existe no projeto e seria simples adicionar o build step.