W
Wasp2w ago
BeReal

ERR_MODULE_NOT_FOUND problem with config

When I do import { config } from 'wasp/client' I get a problem with code: 'ERR_MODULE_NOT_FOUND', url: 'file:///Users/bereal/wasp_project/app/.wasp/out/sdk/wasp/dist/client/config' Has anyone faced that before?
8 Replies
kapa.ai
kapa.ai2w ago
Hi @BeReal. 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, it seems you're encountering an issue related to importing the client configuration in Wasp. This problem could be due to a few reasons: 1. Incorrect import statement: The correct import for the client configuration should be:
import { config } from 'wasp/client'

import { config } from 'wasp/client'

Make sure you're using this exact import statement Accessing the configuration. 2. Wasp version mismatch: Ensure you're using the latest version of Wasp. Some issues with imports have been resolved in newer versions. 3. Incomplete build: The error suggests that the SDK might not be properly built. Try running wasp clean followed by wasp start to rebuild the project Discord support thread. 4. Node.js version: Make sure you're using a compatible Node.js version. Wasp has had some issues with Node.js versions above 18.18.0 Discord support thread. If the problem persists after trying these steps, it might be a bug in the current Wasp version. In that case, you should report the issue to the Wasp team on their GitHub repository or Discord channel. Remember that the client configuration object should contain fields like apiUrl, which you can access after a successful import Accessing the configuration. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @BeReal, 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?
BeReal
BeRealOP2w ago
these are the files I see at teh location mentioned in the error
No description
BeReal
BeRealOP2w ago
wasp clean and starting it again doesn't work @kapa.ai , I do recall accidentally modifiyng some of the files in the .wasp folder, can that still give problems even after a wasp clean?
kapa.ai
kapa.ai2w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Based on the information provided in the knowledge sources, modifying files in the .wasp folder can indeed cause problems, even after running wasp clean. Here's why: 1. The .wasp folder contains generated code and should not be modified manually. As mentioned in the Discord support thread, "You shouldn't be touching any of the .wasp folder files since your changes will get overwritten next time you start wasp start." 2. While wasp clean is designed to remove generated files and dependencies, it might not fully address issues caused by manual modifications to the .wasp folder. To resolve this issue, you can try the following steps: 1. Delete the entire .wasp folder manually. 2. Run wasp clean to ensure all generated files and dependencies are removed. 3. Run wasp start to regenerate the necessary files and start your project. If the problem persists after these steps, you might need to consider recreating your project from scratch or restoring from a backup made before the modifications to the .wasp folder. For future reference, it's important to remember that you should never modify the contents of the .wasp folder directly. If you need to make changes to your Wasp project, focus on modifying the files in your project's root directory and let Wasp handle the generation of files in the .wasp folder. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @BeReal, 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
miho2w ago
Do you get the error in your IDE or when running the app?
BeReal
BeRealOP2w ago
when running the app in the logs I see it after doing wasp start
MEE6
MEE62w ago
Wohooo @BeReal, you just became a Waspeteer level 3!
miho
miho2w ago
Could you share more details so we can maybe try to reproduce this bug? Because for it works when importing it like this
No description

Did you find this page helpful?