petercat-ai / petercat

A conversational Q&A agent configuration system, self-hosted deployment solutions, and a convenient all-in-one application SDK, allowing you to create intelligent Q&A bots for your GitHub repositories
https://petercat.ai
MIT License
595 stars 16 forks source link

Using Vite to import the npm package @petercatai/assistant results in an error. #468

Open sedationh opened 1 week ago

sedationh commented 1 week ago

Describe the bug Using Vite to import the npm package @petercatai/assistant results in an error.

image UserController.js:4 Uncaught ReferenceError: process is not defined at UserController.js:4:17

To Reproduce

The issue can be reproduced as mentioned.

Additional context

Currently, you can add a configuration similar to the one below to work around the issue.

export default defineConfig({
  plugins: [react()],
  define: {
    "process.env.NEXT_PUBLIC_API_DOMAIN": JSON.stringify(
      "https://your-api-domain.com"
    ),
  },
});