Skip to content

Does iTwinUI work with Qwik apps? #934

Answered by mayank99
r100-stack asked this question in Q&A
Discussion options

You must be logged in to vote

This error likely has nothing to do with qwik itself.

I cannot access your sample repo (might be private) but if I had to guess, you are using qwik city, which is an SSR framework for qwik (similar to nextjs or astro). qwik city uses vite for SSR, and it's tricky to make it work out of the box.

Try adding type: module to your package.json and see if it changes the error you get.

After that, try adding @itwin/itwinui-react and @itwin/itwinui-css to ssr.noExternal in your vite config.

export default defineConfig({
  /* ...rest of your vite config */

  ssr: {
    noExternal: [
      '@itwin/itwinui-react',
      '@itwin/itwinui-css',
    ]
  }
});

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mayank99
Comment options

@r100-stack
Comment options

@mayank99
Comment options

@mayank99
Comment options

@r100-stack
Comment options

Answer selected by r100-stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants