Skip to content
Discussion options

You must be logged in to vote

This is caused by nextjs' SSR nature and an unfortunate design choice of the window module. The workaround is to dynamically import the window module instead so that the code that requires the navigator runs on the client side (btw all tauri apis only work on the client side, but iirc only the window and path modules need dynamic imports).

const openAboutPage = async () => {
  const window = await import('@tauri-apps/api/window')
  const webview = new window.WebviewWindow('about_window', {
    title: 'About',
    width: 400,
    height: 200,
    url: '/about'
  })
  webview.once('tauri://created', () => {})
  webview.once('tauri://error', (e: any) => {
    console.error(e)
  })
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@laijackylai
Comment options

Answer selected by FabianLars
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants