fix(client): ensure presetEnv is loaded (#39431)
Prior to this, if a user first loaded a React challenge and then navigated to a JS challenge, they would see TypeError: Cannot read property 'presets' of undefined in the console and be unable to run tests or evaluate code until they reloaded the page.pull/39434/head
parent
7155c87e8b
commit
eb75f8c8cc
|
@ -59,8 +59,9 @@ async function loadBabel() {
|
|||
}
|
||||
|
||||
async function loadPresetEnv() {
|
||||
if (presetEnv) return;
|
||||
if (babelOptionsJSBase && babelOptionsJSBase.presets) return;
|
||||
/* eslint-disable no-inline-comments */
|
||||
if (!presetEnv)
|
||||
presetEnv = await import(
|
||||
/* webpackChunkName: "@babel/preset-env" */ '@babel/preset-env'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue