Taha
Taha
WWasp
Created by Taha on 2/26/2025 in #🙋questions
WebSocket Not Working in Production – Docker Server Rejects Connections
Hi Wasp team, I am experiencing an issue with WebSocket connections in my self-hosted production environment. After investigating, I found that the Docker server itself is rejecting WebSocket connections. Issue Summary: WebSockets work perfectly in my local environment. REST API works fine in production, so Nginx is correctly forwarding requests to the backend. However, WebSocket connections fail in production, and after debugging, I found that the Docker server is not accepting WebSocket requests. What I’ve Tried: Checked Nginx configuration → WebSocket settings are correctly set (proxy_set_header Upgrade $http_upgrade;, etc.). Tested direct WebSocket connection inside the server (curl -i -N -H "Upgrade: websocket" ...) → Docker returns "400 Bad Request - Transport unknown". Checked logs from my backend service inside the Docker container → No WebSocket connections are being registered, meaning the requests are not reaching socket.io. It seems that WebSocket requests are being blocked or not properly handled inside the Dockerized Wasp backend. Question: How should I configure Wasp + Docker to ensure WebSockets work correctly in production? Are there any specific settings required for WebSocket support in a self-hosted Docker setup? Thanks in advance for your help! Best regards, Taha
10 replies
WWasp
Created by Taha on 2/14/2025 in #🙋questions
Configuration Causing API Conflicts in Wasp Application
I am developing an application using Wasp version 0.16.0 and have encountered an issue with middleware configuration leading to conflicts between different API routes. Context: • Application Setup: The application includes multiple APIs, such as a payment webhook and an AI callback endpoint. • Middleware Configuration: Specific middleware functions are defined for each API to handle tasks like CORS settings and request parsing. Issue: Adding the AI callback API to the main.wasp file causes the application to crash, and the payment module becomes non-functional. Removing the AI callback API configuration restores functionality, indicating a conflict arising from the middleware configurations. Observations: • Potential Middleware Conflict: The middleware defined for the AI callback API might be impacting other routes, including the payment webhook. • Global vs. Specific Middleware: Attempts to isolate middleware configurations to specific APIs to prevent global interference have not resolved the issue. Request for Assistance: Could you provide guidance on: 1. Best Practices: Recommended practices for configuring middleware in Wasp to ensure that middleware applied to one API does not affect others. 2. Debugging Steps: Specific debugging steps or tools within Wasp to identify and resolve middleware conflicts between APIs. 3. Documentation: Detailed documentation or examples illustrating the proper setup of per-API middleware configurations to avoid such conflicts. I appreciate your assistance in resolving this issue, as it is critical to my application’s functionality. Best regards,
6 replies
WWasp
Created by Taha on 2/7/2025 in #🙋questions
Issue Deploying Frontend - "Cannot find package 'wasp'" (Wasp 0.15)
Hi Wasp Support, I'm trying to deploy the frontend of my Wasp application on a production VM using Wasp 0.15.0 but I keep getting this error when running npm run build: up to date, audited 79 packages in 815ms 11 packages are looking for funding run npm fund for details found 0 vulnerabilities
[email protected] build npm run validate-env && tsc && vite build
[email protected] validate-env node -r dotenv/config ./scripts/validate-env.mjs
node:internal/modules/esm/resolve:854 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null); ^ Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'wasp' imported from /home/admin/sas/build/web-app/scripts/validate-env.mjs at packageResolve (node:internal/modules/esm/resolve:854:9) at moduleResolve (node:internal/modules/esm/resolve:927:18) at defaultResolve (node:internal/modules/esm/resolve:1169:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) at link (node:internal/modules/esm/module_job:95:36) { code: 'ERR_MODULE_NOT_FOUND' } Current setup: Wasp version: 0.15.0 Node.js version: 20.18.2 npm version: 10.8.2
9 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
I am currently developing an application using Wasp and aim to integrate a custom third-party authentication system. This system requires sending a combination of login and password to a specific API endpoint and receiving a DTO containing a user ID in response. My objective is to utilize this user ID to either log in existing users or create new accounts within my Wasp application, effectively replacing the default authentication methods. Could you provide guidance on the best practices for implementing such a custom authentication flow in Wasp? Specifically, I am interested in: The recommended approach to send user credentials to the external API securely and handle the response appropriately. How to manage user sessions and state within Wasp when bypassing the built-in authentication mechanisms. Any potential challenges or considerations to be aware of when integrating a custom authentication method that deviates from the standard social authentication providers supported by Wasp. I appreciate your assistance and any documentation or examples you can provide to facilitate this integration. Best regards,
30 replies