how to downgrade from wasp version?
Hi, how do i downgrade to an older version of wasp? It says for me: Wasp requires package "react-router-dom" to be version "^6.26.2" in package.json.
14 Replies
Hi @ApexFossa45. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To downgrade to an older version of Wasp, you can use the installer script with a specific version. This is particularly useful when you need to match a project's requirements or resolve dependency conflicts like the one you're experiencing with "react-router-dom".
Currently, Wasp doesn't have a built-in command like
wasp downgrade
or wasp version use
, though these features have been discussed in the community as potential improvements (Make process of updating Wasp nicer).
Here's how you can downgrade:
1. Use the installer script with a specific version parameter. You'll need to run the installer command with the version you want to use.
2. If you're working on a specific project, you should check what version it requires. In newer Wasp projects (0.12.0+), this is specified in the Wasp file with a version field.
Regarding your specific error about "react-router-dom" version, this is happening because Wasp dictates exact versions of certain packages it uses internally. In the current version of Wasp, you cannot specify a different version of a dependency that Wasp already uses internally (Project Dependencies).
The Wasp team is aware of this limitation and is working on improvements to allow more flexibility with dependency versions (Allow specifying npm dependency that Wasp already uses, with different version).
For now, you'll need to use the exact version of "react-router-dom" that Wasp requires (^6.26.2) in your package.json file.
I hope this helps! Let me know if you need more specific guidance on downgrading to a particular Wasp version.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ApexFossa45, 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?thanks, another issue is my server stopped returning any data for any endpoint, how can i fix this? e.g. https://ai-creations-central-server.fly.dev/operations/get-latest-creations should return latest creations for all users @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the information in the knowledge sources, there are several potential reasons why your server might have stopped returning data from endpoints after deployment on fly.io. Let's explore some troubleshooting steps:
Possible Causes and Solutions
1. CORS Issues
Your server might not be properly configured to handle cross-origin requests. Unlike Operations, APIs don't utilize default middleware, so you need to ensure CORS is enabled.
Making Sure CORS Works
2. Deployment Issues
Several users have experienced similar issues with fly.io deployments that suddenly stopped working:
- Try redeploying your app with
wasp deploy fly deploy
- Check your server logs in the fly.io dashboard for any error messages
- Look at the Network tab in your browser's developer tools to see if requests are timing out or returning specific error codes
3. Certificate Issues
If you're using a custom domain, there might be issues with your SSL certificates:
- Check if your certificates need to be renewed
- Verify your DNS settings (A, AAAA, and CNAME records)
4. Database Connection
Your server might be failing to connect to the database:
- Check the server logs for any database connection errors
- Try restarting your database with flyctl postgres restart -a your-db-app-name
Next Steps
1. Check your fly.io server logs for any error messages
2. Look at the Network tab in your browser to see what response (if any) you're getting
3. Try redeploying your application
4. If you're using a custom domain, verify your DNS and certificate settings
If none of these solutions work, you might need to provide more specific error messages from your logs to get more targeted help.
Let me know if any of these steps help resolve your issue or if you need further assistance!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ApexFossa45, 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?thanks, do i have to enable cors for all endpoints? e.g. import cors from 'cors'
import { config } from 'wasp/server'
export const serverMiddlewareFn = (middlewareConfig) => {
// Example of adding extra domains to CORS.
middlewareConfig.set('cors', cors(
{
origin: [config.frontendUrl, 'https://aicreationscentral.com', 'https://ai-creations-central-client.fly.dev']
,methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'] // Add all required HTTP methods
,credentials: true, // If cookies or auth tokens are used
}
))
return middlewareConfig -- should i add the esrver to the origin list? ai-creations-central-server.fly.dev?
thanks, do i have to enable cors for all endpoints? e.g. import cors from 'cors'
import { config } from 'wasp/server'
export const serverMiddlewareFn = (middlewareConfig) => {
// Example of adding extra domains to CORS.
middlewareConfig.set('cors', cors(
{
origin: [config.frontendUrl, 'https://aicreationscentral.com/', 'https://ai-creations-central-client.fly.dev/']
,methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'] // Add all required HTTP methods
,credentials: true, // If cookies or auth tokens are used
}
))
return middlewareConfig -- should i add the esrver to the origin list? ai-creations-central-server.fly.dev? @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the knowledge sources, I can help you with your CORS configuration in Wasp.
You don't need to enable CORS for all endpoints individually. Wasp provides a global middleware configuration that applies to all routes. Your approach of using
serverMiddlewareFn
is correct for configuring CORS globally.
Regarding your specific configuration:
1. For the origin
list, you should:
- Remove trailing slashes from your domains (they can cause CORS issues)
- Include your server URL only if you're making client-side requests from that domain
- Make sure the URLs exactly match where your frontend is running
2. Your configuration should look like this:
The config.frontendUrl
is automatically set to the value of the WASP_WEB_CLIENT_URL
environment variable, which is required when deploying your app Deploying Manually.
You generally don't need to add your server URL to the origins list unless you're making client-side requests from that domain. The origins list should only include domains where your frontend client code is running.
If you're still experiencing CORS issues after this configuration, make sure your environment variables are correctly set:
- WASP_WEB_CLIENT_URL
should point to your frontend URL
- Check that there are no trailing slashes in these URLs
This should resolve your CORS issues across all endpoints.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ApexFossa45, 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?npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm error code EISDIR
npm error syscall symlink
npm error path \wsl.localhost\Ubuntu\root\Projects\aicreationscentral.wasp\out\sdk\wasp
npm error dest \wsl.localhost\Ubuntu\root\Projects\aicreationscentral\node_modules\wasp
npm error errno -4068
npm error EISDIR: illegal operation on a directory, symlink '\wsl.localhost\Ubuntu\root\Projects\aicreationscentral.wasp\out\sdk\wasp' -> '\wsl.localhost\Ubuntu\root\Projects\aicreationscentral\node_modules\wasp' -- @kapa.ai whats the issue? im trying to deploy my project
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the error message you're seeing, there are two main issues:
1. The primary error is related to WSL2 file system access: You're trying to run Wasp on files located on the Windows file system (indicated by the
\\wsl.localhost\Ubuntu\
path) rather than the Linux file system.
2. The npm symlink error (EISDIR: illegal operation on a directory, symlink
) is occurring because WSL2 has limitations when working with the Windows file system, particularly with symlinks.
Solution
The most straightforward fix is to move your Wasp project to the Linux file system within WSL2. This is a known issue with WSL2 that affects not just file change detection but also npm operations like creating symlinks.
As mentioned in the Wasp documentation:
If you are using WSL2, make sure that your Wasp project is not on the Windows file system, but instead on the Linux file system. Otherwise, Wasp won't be able to detect file changes, due to the issue in WSL2. Quick Start DocumentationHere's how to fix it: 1. Move your project to the Linux file system: 2. Navigate to the project in the Linux file system and try running Wasp again: If you're still having issues after moving your project, you can try running
wasp clean
to remove all generated files and node_modules, then start fresh with wasp start
.
The deprecation warnings about abab
and domexception
are not critical - they're coming from dependencies used by react-scripts and won't prevent your app from working.
For more detailed guidance on using Wasp with WSL, check out this article: Supercharge Your Windows Development: The Ultimate Guide to WSL
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @ApexFossa45, 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?@kapa.ai
Let me check the knowledge base for you again. One moment! :books:
Sorry @ApexFossa45, 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?
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm error code EISDIR
npm error syscall symlink
npm error path \wsl.localhost\Ubuntu\root\Projects\aicreationscentral.wasp\out\sdk\wasp
npm error dest \wsl.localhost\Ubuntu\root\Projects\aicreationscentral\node_modules\wasp
npm error errno -4068
npm error EISDIR: illegal operation on a directory, symlink '\wsl.localhost\Ubuntu\root\Projects\aicreationscentral.wasp\out\sdk\wasp' -> '\wsl.localhost\Ubuntu\root\Projects\aicreationscentral\node_modules\wasp' -- @kapa.ai still get this
Let me check the knowledge base for you again. One moment! :books:
----------------------
I see you're still encountering the same symlink error. This is definitely a WSL-related issue with how Wasp's SDK is structured and how npm handles symlinks between Windows and Linux file systems.
Based on the error path (
\\wsl.localhost\Ubuntu\root\Projects\aicreationscentral
), it appears your project is still being accessed through the Windows file system path rather than a native Linux path, even though you may have moved it to the Linux file system.
Here are some specific steps to resolve this issue:
1. Make sure you're accessing your project through the Linux path:
When in WSL, your path should look like /root/Projects/aicreationscentral
not \\wsl.localhost\Ubuntu\root\Projects\aicreationscentral
2. Check how you're opening the project:
If you're using VS Code, make sure you're opening it from within WSL, not from Windows. Use code .
from the WSL terminal when in your project directory.
3. Try a clean reinstall:
This issue is related to how Wasp installs its SDK package. As mentioned in the Wasp documentation:
Wasp generates SDK (library) Code that covers all the functionalities Wasp users import and use in User code. This SDK is installed as a local npm package in your project.Figure out Wasp's node_modules story The symlink error occurs because npm is trying to create a symbolic link from your project's node_modules to the SDK in the .wasp directory, but WSL has limitations when working with Windows paths. If you continue to have issues, you might want to try creating a completely new project directly in the Linux file system (not accessing it through Windows paths at all) and then copying your source files over. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ApexFossa45, 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?
@miho one for you maybe.
@ApexFossa45 which version of Wasp did you use previously? To which version did you upgrade?
I'd advise you to follow the migration guides and finish the migration to the latest version: https://wasp.sh/docs/migration-guides/migrate-from-0-14-to-0-15 (one of the migration guides, you'll find others in the sidebar)
Migration from 0.14.X to 0.15.X | Wasp
What's new in 0.15.0?
Thanks! I'll look into it, i think I used version 14 before