-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Neither old (experimental) decorators nor new (stage 3) decorators work since upgrading to Deno 1.40 #296
Comments
+1 🙏🏻 import { Service } from "npm:@bluelibs/core";
@Service()
class A {
init() {
return true;
}
} Results in:
I've had to rewrite part of an external library because of this. |
The core of the issue is that I'd like to use typedi which requires: "emitDecoratorMetadata": true,
"experimentalDecorators": true, Is it possible to have this set in the runtimes |
With By then adding |
It would be preferable to have access to the |
I can confirm that decorators no longer work since edge-runtime upgraded to release v1.34.0 (87f8b69), which traces back to this PR in Deno, where experimentalDecorators was disabled as default (denoland/deno#22101). My upcoming port of TSOA for Deno (https://github.com/louis-amhild/tsoa-deno) stopped working in Supabase and I couldn't understand why (thanks for posting this bug @hammerlscs). As announced by the Deno team disabling experimentalDecorators is a very impactful change as "code that was deployed and executed successfully before the change might fail either at build time or runtime if it is redeployed now without any change." (https://deno.com/deploy/changelog#2024-02-22). However they have argued to make the change anyway as developers can just enable experimentalDecorators in the config - which is obviously not possible in Supabase and thous we have this issue. Waiting for stage 3 decorators to be fixed in Deno (denoland/deno#22419) will only solve the issue partly, as the new decorators in typescript 5 has a different syntax and still lack features ie. “does not allow decorating parameters” for example I think @geoffreygarrett is right that enabling experimentalDecorators as default again is a good solution until Supabase introduces Deno config (some day?) or the stage 3 decorators are fully implemented and adopted in more libraries (in some years). Enabling it would solve the issue and return the previous behaviour as before edge v1.34.0. Unfortunately I'm not really familiar with the code base so it is difficult for me to make a PR, but maybe someone else could? Maybe you know if it would be easy to enable experimentalDecorators again @andreespirela? |
Sounds reasonable to me |
So, could we get it enabled in the runtime container's config for now? |
🎉 This issue has been resolved in version 1.43.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
I don't know if you are in a hosted or self-hosted environment, but if you are self-hosted, you can now enable the decorator feature (see this link). If you are using a hosted (Supabase Cloud) environment, it will probably take a while for the decorator feature to be enabled. |
Can this please be re-opened? The issue is only fixed if you are running Supabase in a self-hosted environment. |
@laktek Just got this error too. Can we reopen? supabase-edge-runtime-1.53.3 (Deno v1.40.3) |
Bug report
Describe the bug
Neither the old (experimental) decorators nor the new (stage 3) decorators work since upgrading to Deno 1.40:
The new stage 3 decorators possibly do not work because of: denoland/deno#22419
And the old experimental decorators possibly do not work, because using them requires the configuration
(https://deno.com/blog/v1.40#decorators)
To Reproduce
Create either an edge function with the new stage 3 decorator syntax such as:
Or create an edge function with the old experimental decorators such as:
Then call the edge function:
Expected behavior
The decorators work as expected
System information
Tested with Supabase CLI v1.150.0 and v1.151.0
The text was updated successfully, but these errors were encountered: