Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Warn users about export Elysia as a default #384

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ export default defineConfig({
// link: '/integrations/cheat-sheet'
// }
]
},
{
text: 'Support',
collapsed: true,
items: [
{
text: 'Troubleshooting',
link: '/support/troubleshooting'
}
]
}
],
socialLinks: [
Expand Down
6 changes: 5 additions & 1 deletion docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ button.copy::after {
background-image: url(/assets/integration.svg);
}

.dark #VPSidebarNav > .group:nth-child(-n + 9):not(:first-child) > .VPSidebarItem > .item > .text::before {
#VPSidebarNav > .group:nth-child(10) > .VPSidebarItem > .item > .text::before {
background-image: url(/assets/help.svg);
}

.dark #VPSidebarNav > .group:nth-child(-n + 10):not(:first-child) > .VPSidebarItem > .item > .text::before {
filter: invert(1);
}

Expand Down
1 change: 1 addition & 0 deletions docs/public/assets/help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/support/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Troubleshooting - ElysiaJS
head:
- - meta
- property: 'og:title'
content: Troubleshooting - ElysiaJS

- - meta
- name: 'description'
content: This section helps you resolve common issues in ElysiaJS. Whether you're facing compatibility problems, configuration errors, performance bottlenecks, or bugs from updates, you'll find guidance here. Start by consulting the documentation and community channels for potential solutions. Make use of debugging tools and logs to pinpoint issues. Keeping your environment well-configured and updated can prevent many common problems.

- - meta
- property: 'og:description'
content: This section helps you resolve common issues in ElysiaJS. Whether you're facing compatibility problems, configuration errors, performance bottlenecks, or bugs from updates, you'll find guidance here. Start by consulting the documentation and community channels for potential solutions. Make use of debugging tools and logs to pinpoint issues. Keeping your environment well-configured and updated can prevent many common problems.
---

# Troubleshooting

## EADDRINUSE: Failed to start server. Is port in use?

Do **not** `export default app` as Bun's [auto-execution](https://bun.sh/docs/api/http#object-syntax) feature will cause the Elysia server to run twice.

Do this:

```typescript
export const app = new Elysia().listen(3000)
```

Instead of:

```typescript
const app = new Elysia().listen(3000)

export default app
```

For more details, checkout: [elysiajs/elysia#550](https://github.com/elysiajs/elysia/issues/550)