P1 bug in wasp causing insanity in developer. Please isolate and fix. :-)
I just spent a day tracking down a problem, which manifests itself in a very unusual way,.
Adding this line of code (to a server-side .js file):
import { subtractCredits } from 'wasp/server/operations'
This causes relative imports to stop working, and you can't fix the build by fixing them (obvious now, not so a few hours ago). The broken import is the only error emitted during the build, so the tools leave you in a hole. Git archaeology FTW.
-------
In main.wasp we have defined subtractCredits as follows:
action subtractCredits {
fn: import { subtractCredits } from "@src/payment/creditManagement.js",
entities: [User]
}
and in src/payment/creditManagement.ts we have a "export const subtractCredits = async (args, context) => { ... }.
Not 100% certain what's wrong here. This code is server side as stated above. We call it successfully from client. This is the first time I tried to call it from server, and not only does it not work, it silently murders the build.
[EDIT: Just saw the mismatch between .js and .ts in the import/actual filetype, unfortunately that was not the cause of the problem as the imports still break after fixing...]
Adding this line of code (to a server-side .js file):
import { subtractCredits } from 'wasp/server/operations'
This causes relative imports to stop working, and you can't fix the build by fixing them (obvious now, not so a few hours ago). The broken import is the only error emitted during the build, so the tools leave you in a hole. Git archaeology FTW.
-------
In main.wasp we have defined subtractCredits as follows:
action subtractCredits {
fn: import { subtractCredits } from "@src/payment/creditManagement.js",
entities: [User]
}
and in src/payment/creditManagement.ts we have a "export const subtractCredits = async (args, context) => { ... }.
Not 100% certain what's wrong here. This code is server side as stated above. We call it successfully from client. This is the first time I tried to call it from server, and not only does it not work, it silently murders the build.