diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 89722a05..3fd3dbc0 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -443,6 +443,16 @@ export default defineConfig({ // link: '/integrations/cheat-sheet' // } ] + }, + { + text: 'Support', + collapsed: true, + items: [ + { + text: 'Troubleshooting', + link: '/support/troubleshooting' + } + ] } ], socialLinks: [ diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css index 2de905f4..87c51e8f 100644 --- a/docs/.vitepress/theme/custom.css +++ b/docs/.vitepress/theme/custom.css @@ -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); } diff --git a/docs/public/assets/help.svg b/docs/public/assets/help.svg new file mode 100644 index 00000000..87807c32 --- /dev/null +++ b/docs/public/assets/help.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/support/troubleshooting.md b/docs/support/troubleshooting.md new file mode 100644 index 00000000..0212c326 --- /dev/null +++ b/docs/support/troubleshooting.md @@ -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)