import { MdxImage } from "@/components/MdxImage";

import ClearAppData from "./images/clear-app-data.webp";
import Logout from "./images/logout.webp";
import UncaughtPromise from "./images/uncaught-promise.webp";

export const metadata = {
  title: "Formbricks Open Source Contribution Guide: How to Enhance yourself and Contribute to Formbricks",
  description:
    "Join the Formbricks community and learn how to effectively contribute. From raising issues and feature requests to creating PRs, discover the best practices and communicate with our responsive team on Discord",
};

#### Contributing

# Troubleshooting

Here you'll find help with frequently recurring problems

## "The app doesn't work after doing a prisma migration"

This can happen but fear not, the fix is easy: Delete the application storage of your browser and reload the page. This will force the app to re-fetch the data from the server:

<MdxImage
  src={ClearAppData}
  alt="Demo App Preview"
  quality="100"
  className="max-w-full rounded-lg sm:max-w-3xl"
/>

## "I ran 'pnpm i' but there seems to be an error with the packages"

If nothing helps, run `pnpm clean` and then `pnpm i` again. This solves a lot.

## "I get a full-screen error with cryptic strings"

This usually happens when the Formbricks Widget wasn't correctly or completely built.

<Col>
<CodeGroup title="Build js library first and then run again">

```bash
pnpm build --filter=@formbricks/js

// Run the app again
pnpm dev
```

</CodeGroup>
</Col>
## My machine struggles with the repository

Since we're working with a monorepo structure, the repository can get quite big. If you're having trouble working with the repository, try the following:

<Col>
<CodeGroup title="Only run the required project">

```bash {{ title: 'Formbricks Web-App' }}
pnpm dev --filter=@formbricks/web...
```

```bash {{ title: 'Formbricks Docs' }}
pnpm dev --filter=@formbricks/docs...
```

```bash {{ title: 'Formbricks Demo App' }}
pnpm dev --filter=@formbricks/demo...
```

</CodeGroup>
</Col>
However, in our experience it's better to run `pnpm dev` than having two terminals open (one with the Formbricks app and one with the demo).

## Uncaught (in promise) SyntaxError: Unexpected token !DOCTYPE ... is not valid JSON

<MdxImage
  src={UncaughtPromise}
  alt="Uncaught promise"
  quality="100"
  className="max-w-full rounded-lg sm:max-w-3xl"
/>

This happens when you're using the Demo App and delete the Person within the Formbricks app which the widget is currently connected with. We're fixing it, but you can also just logout your test person and reload the page to get rid of it.

<MdxImage src={Logout} alt="Logout Person" quality="100" className="max-w-full rounded-lg sm:max-w-3xl" />
