W
Wasp2d ago
Noah

New error in deployment

[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'

Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'

Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
I don't see a src/server.ts in my codebase, any ideas here?
2 Replies
kapa.ai
kapa.ai2d ago
Hi @Noah. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- This error seems to be related to the Wasp project structure and how the SDK is being loaded during deployment. Let's analyze the issue based on the available information: 1. The error suggests that the file /app/.wasp/out/sdk/wasp/dist/server/index.js is missing or cannot be accessed during deployment. 2. You mentioned that you don't see a src/server.ts in your codebase. This is expected in newer versions of Wasp (0.12.0 and later), as the project structure has changed. Here are some possible reasons and solutions for this error: 1. Outdated Wasp version: Make sure you're using the latest version of Wasp. You can check your version with wasp version and update if necessary. The new project structure was introduced in Wasp 0.12.0, as mentioned in the Migration from 0.11.X to 0.12.X guide. 2. Incomplete build: The error suggests that the SDK is not being properly built or included in the deployment. Try running wasp build locally before deploying to ensure all necessary files are generated. 3. Deployment configuration: Ensure that your deployment configuration (e.g., Dockerfile or deployment scripts) is up-to-date and compatible with the latest Wasp project structure. 4. Clean and rebuild: Try running wasp clean followed by wasp build to ensure a fresh build of your project. 5. Check for any custom modifications: If you've made any custom changes to the project structure or build process, make sure they're compatible with the current Wasp version. If the issue persists after trying these steps, you may want to: 1. Double-check your main.wasp file for any incorrect import paths or configurations. 2. Review the project structure documentation to ensure your project follows the correct layout. 3. If you're using a deployment platform like Fly.io, make sure you're following the latest deployment guidelines for Wasp projects. If none of these solutions work, you may need to provide more information about your project structure, Wasp version, and deployment process for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Noah, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Noah
NoahOP2d ago
This feels like it broke from under me, any help appreciated.. I've tried old versions where it used to work, and I get the same error also tried wasp 0.16.2 happens on railway up:
> rollup --config --silent


[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'



✕ [server-builder 11/11] RUN cd .wasp/build/server && npm run bundle
process "/bin/sh -c cd .wasp/build/server && npm run bundle" did not complete successfully: exit code: 1


Dockerfile:42

-------------------

40 | RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma'

41 | # Building the server should come after Prisma generation.

42 | >>> RUN cd .wasp/build/server && npm run bundle

43 |

44 |

-------------------

ERROR: failed to solve: process "/bin/sh -c cd .wasp/build/server && npm run bundle" did not complete successfully: exit code: 1
> rollup --config --silent


[!] Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'
Error: Could not load /app/.wasp/out/sdk/wasp/dist/server/index.js (imported by src/server.ts): ENOENT: no such file or directory, open '/app/.wasp/out/sdk/wasp/dist/server/index.js'



✕ [server-builder 11/11] RUN cd .wasp/build/server && npm run bundle
process "/bin/sh -c cd .wasp/build/server && npm run bundle" did not complete successfully: exit code: 1


Dockerfile:42

-------------------

40 | RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma'

41 | # Building the server should come after Prisma generation.

42 | >>> RUN cd .wasp/build/server && npm run bundle

43 |

44 |

-------------------

ERROR: failed to solve: process "/bin/sh -c cd .wasp/build/server && npm run bundle" did not complete successfully: exit code: 1
I rage switched back to fly.io LOL

Did you find this page helpful?