import type FS from 'fs' ; let secretRequire ; try { secretRequire = eval ( 'require' ) ; } catch ( err ) { secretRequire = undefined ; } export default function serverRequire ( module ) { if ( ! secretRequire ) { throw new Error ( `Unexpected serverRequire() -- can only do this from a Node server!` ) ; } return secretRequire ( module ) ; } export function serverRequireFs ( ) { return serverRequire ( 'fs' ) as typeof FS ; }