# Using GoTrue library in Sveltekit gives this error at build time: GoTrue is not a constructor

**URL:** <https://forum.devtalk.com/t/using-gotrue-library-in-sveltekit-gives-this-error-at-build-time-gotrue-is-not-a-constructor/18060>\
**Category:** Frontend Questions/Help\
**Tags:** svelte, vite, sveltekit, gotrue\
**Created:** [19 August 2021 14:44 UTC](https://forum.devtalk.com/t/using-gotrue-library-in-sveltekit-gives-this-error-at-build-time-gotrue-is-not-a-constructor/18060 "2021-08-19T14:44:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClaudiaGiv](https://forum.devtalk.com/user_avatar/forum.devtalk.com/claudiagiv/32/3000_2.png) [@ClaudiaGiv](https://forum.devtalk.com/u/ClaudiaGiv)\
**Post date:** [19 August 2021 14:44 UTC](https://forum.devtalk.com/t/using-gotrue-library-in-sveltekit-gives-this-error-at-build-time-gotrue-is-not-a-constructor/18060/1 "2021-08-19T14:44:06Z")

</div>

I have a _ **sveltekit project** _ that is using _ **GoTrue library** _ for authentication. In development mode (_npm run dev_) everything works but when I build for production (_npm run build_) it gives this error:

> GoTrue is not a constructor
> 
> TypeError: GoTrue is not a constructor

**Reproduction**  
GitHub repo: [GitHub - ClaudiaGiv/sveltekit-tailwindcss-board](https://github.com/ClaudiaGiv/sveltekit-tailwindcss-board)

I also tested if the problem is with vite by creating a _ **svelte project** _ with _ **vite** _ and adding the **GoTrue library** and it works also on development mode and also the build for production. So considering this, it seems that the problem is strictly with sveltekit, not with vite but I don’t understand exactly why or how to fix it.

**GitHub repo** : [GitHub - ClaudiaGiv/vite-svelte-project](https://github.com/ClaudiaGiv/vite-svelte-project)

Does anyone know or have any idea what could be the problem and how can it be fixed?

Thank you!
