-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolving ext-src
imports in the SDK if the user declares an import with the .js
ext
#2096
Comments
Sending this back to triage, multiple people had this and error message is quite confusing, we should take care of it. |
This is in a way related to #2087 , as they might share a solution, which is us completely forbidding, in main.wasp, to have .js or .ts extensions in ext imports, or, another solution, somehow additionally processing extensions to fit with what Wasp requires. |
User said following:
That is peculiar! Might it mean that one of the deps updated minor version and caused this that way? |
The error is only triggered when you import an operation from You need the following Wasp file: app extension {
wasp: {
version: "^0.13.0"
},
title: "example",
server: { setupFn: import { setup } from "@src/setup" }
}
// ...
action jsAction {
fn: import { jsAction } from "@src/jsAction.js"
} And the following code in import { jsAction } from "wasp/server/operations";
export function setup() {
console.log(jsAction);
} The error only happens when:
If any of the conditions aren't met, there's no error. You need all four to trigger it. This is probably why our user felt the issue appeared out of thin air - it was caused by something seemingly unrelated. Since this specific problem was fixed with Wasp 0.14.0 thanks to this change introduced in commit c184a9b, I'm closing the issue. We still have other extension-related problems which I covered here: #2222. |
Users get a weird error saying they can't import
queries.js.js something something
.I've reproduced with the latest Wasp version:
0.13.2
As far as I can see, it seems related to the exports fields and the
ext-src/*
entry 😄Two instances on Discord:
The text was updated successfully, but these errors were encountered: