Unexpected error during the build of the frontend in Production
Hello, when i launch:
This error occurred
Any idea how to solve that? I didn't change anything. Thank you
5 Replies
Hi @DanjelDurmo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, I don't have enough specific details to directly address the exact error you're encountering. However, I can provide some general guidance and suggestions based on related information about Wasp and production builds.
1. Vite Configuration:
Wasp uses Vite for building the client-side application. You might want to check if there's any custom Vite configuration that could be causing issues. As mentioned in the Custom Vite Config documentation, you can customize the Vite config by editing the
vite.config.ts
file in your project root directory. Make sure any custom configurations aren't conflicting with Wasp's default setup.
2. Environment Variables:
The error occurs during the production build process. Make sure you're setting the environment variables correctly. As stated in the Defining Env Vars in Production documentation, client-side environment variables should be provided during the build process. Your command looks correct, but double-check that REACT_APP_API_URL
is the correct variable name expected by your application.
3. Dependencies:
There might be an issue with dependencies or their versions. Try running wasp clean
in your app directory and then wasp start
to remove all the old node_modules and reinstall them, as suggested in one of the Discord conversations.
4. TypeScript Checking:
If you're using TypeScript, there's an ongoing discussion about making type checking optional for production builds. As mentioned in this GitHub issue, you might want to check if there are any TypeScript-related issues in your code or third-party libraries.
5. Wasp Version:
Make sure you're using the latest version of Wasp. You can check your version with wasp version
and update if necessary.
If the problem persists after trying these suggestions, you might want to reach out to the Wasp community on their Discord channel or create a GitHub issue with more details about your project setup, Wasp version, and the full error log.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @DanjelDurmo, 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?@DanjelDurmo I don't know if it will help but I think it's a problem with Vitejs itself. I found a similar issue. https://github.com/vitejs/vite/issues/19147
GitHub
Vite-6.0.7 appears to transpile
case
statements incorrectly · Iss...Describe the bug Taking the base example from StackBlitz, importing js2pdf-2.5.1 and attempting to build fails with an error about unexpected case. Output fails with the following: Error during bui...
A "working" solution here seems to be to downgrade
rollup
from version v4.30.0
https://github.com/vitejs/vite/issues/19147#issuecomment-2573865066@DanjelDurmo what is your app doing? what kind of dependencies are you using? we need some extra info to be able to reproduce the error and help 🙂
This work around worked, but not with version 4.23 but with 4.9.6.
It's still strange because I hadn't done any upgrades, but now the issue is solved. Thank you for support