diff --git a/packages/shell-server/shell-server.js b/packages/shell-server/shell-server.js index 6af15b6c80..ecd66237dd 100644 --- a/packages/shell-server/shell-server.js +++ b/packages/shell-server/shell-server.js @@ -222,6 +222,8 @@ class Server { repl.context = global; repl.useGlobal = true; + setRequireAndModule(repl.context); + // In order to avoid duplicating code here, specifically the complexities // of catching so-called "Recoverable Errors" (https://git.io/vbvbl), // we will wrap the default eval, run it in a Fiber (via a Promise), and @@ -270,8 +272,6 @@ class Server { configurable: true }); - setRequireAndModule(repl.context); - // Some improvements to the existing help messages. function addHelp(cmd, helpText) { const info = repl.commands[cmd] || repl.commands["." + cmd];