W
Wasp3mo ago
randopixel

Problems with operations

I am trying to set up a simple crm foundation. I have added the schema entries and updated schema, i have added the routing and queries/actions to the wasp file, making sure to use the proper pathing - "@src/crm/operations" and routing: route CRMRoute { path: "/crm", to: CRMPage } page CRMPage { authRequired: true, component: import CRMMain from "@src/crm/CRMMain" } all of my components import from 'wasp/client/operations' but, for some reason the system is trying to find the operations in wasp/ext-src/crm/operations. [ Wasp ] server/operations/actions/index.ts(13,52): error TS2307: Cannot find module 'wasp/ext-src/crm/operations' or its corresponding type declarations. [ Wasp ] There are types at '/mnt/d/wasp-projects/st-saas/app/node_modules/wasp/dist/ext-src/crm/operations.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. [ Wasp ] server/operations/actions/index.ts(14,52): error TS2307: Cannot find module 'wasp/ext-src/crm/operations' or its corresponding type declarations. Can anyone tell me whats going on?
2 Replies
kapa.ai
kapa.ai3mo ago
Hi @randopixel. 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, it seems like there might be an issue with how your operations are being imported. In Wasp, operations should be imported from wasp/client/operations or wasp/server/operations depending on whether you're on the server or the client side. This is mentioned in the Github Issue (https://github.com/wasp-lang/wasp/issues/1909) you provided. If you're trying to use these operations on the server, you should import them from wasp/server/operations. Also, remember that when using operations on the server, you need to provide the context as the first argument and then the arguments as the second argument. If you're still facing issues, it might be helpful to clean your project using the wasp clean command and then start it again using wasp start. This was suggested by a community member in a Discord support thread (https://discord.com/channels/686873244791210014/1215750573278629958) and seemed to resolve a similar issue. If none of these solutions work, it would be helpful to know which version of Wasp you're using. You can check this by running wasp version. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @randopixel, 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?
randopixel
randopixelOP3mo ago
It appears a clean and reinstall of the wasp and node modules cleared that. Thanks!
Want results from more Discord servers?
Add your server