Closed win3ry closed 1 week ago
I think I am getting close.
So, apparently, there is a conflict between the contexts that I am trying to pass.
What I tried:
If I move the function verifyApiKey
inside api.ts and run it from here: everything works.
If I put the function verifyApiKey
inside operations.ts without the VerifyApiKey type generated by wasp and import it in api.ts: everything works.
But! I noticed that when the function is using the VerifyApiKey type, there is a conflict with both contexts.
I guess, you're not supposed to call a Query/Action inside an Api. The good implementation of my case is to load my related functions without declaring them as Query/Action.
So the REAL problem here is that if there is such a conflict, the build fails and displays an unrelated error.
Edit: Might be related to #1909.
Hey @win3ry, apologies for the late reply. I don't know how I'm only seeing this now.
Anyway, I tried it out and could not reproduce it. However, your steps to reproduce might be incomplete so I might have got something wrong:
auth: false
in your declarations, but you can't use that if you haven't enabled auth
globally (which isn't mentioned in your steps)s3Utils
, but the reproduction steps don't define anything with that name. Are you sure this is the right error message?User
entity, but its definition is missing.I tried to work around these missing parts by removing auth: false
and defining the User
entity, but can't reproduce the behavior. Here's my project, does that one work for you?
Btw, this error seems very similar to the one we had in version 0.13.x, but has since been fixed in Wasp 0.14.0 (see this comment: https://github.com/wasp-lang/wasp/issues/2096#issuecomment-2263566708). Which version are you using?
Closing for now due to not being able to reproduce, but if needed we can reopen it again!
Describe the bug I have been working for a week on my project. Then, I added an api and a function. and I had a weird error not related to code or any edited file.
I tried to debug for an hour then I setup a fresh install of wasp and tried with just that portion of code to reproduce it. The bug remains the same.
To Reproduce Steps to reproduce the behavior:
Expected behavior
You should see in the console this error: