Created
May 8, 2024 18:10
-
-
Save PatrickJS/458a65df6135ba0a94a103b2a3ea07ab to your computer and use it in GitHub Desktop.
This file contains 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
import { isBrowser } from '@builder.io/qwik/build'; | |
serverOnly(); | |
export function serverOnly() { | |
if (isBrowser) { | |
console.log('SERVER ONLY'); | |
throw new Error( | |
'This module cannot be imported from the Client.' + | |
'It should only be used from the Server.', | |
); | |
} | |
} | |
export default serverOnly; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment