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
No error thrown on extensions not loading. #16640
Comments
Mind sharing a bit more specific reproduction steps to get to this situation? Just adding
|
Here is one file that I had to update after installing 9.21.0 BEFORE:
AFTER:
Unfortunately I have a lot of extensions, so not sure exactly which one breaks, but had to do similar changes as above in all of them. |
I don't think that this is related to #16374. As you know from #16606 the "only" problem with this pull request is that the types aren't exposed anymore. While some type errors might be spit out during the build process of an extension, this has no effect on extension errors during runtime. That being said, I'm able to reproduce the error you've mentioned above and I'm looking into this right now. |
But I got this error on existing extensions. Haven't created a new extension just yet. |
This comment was marked as outdated.
This comment was marked as outdated.
SituationIt seems like the issue is a result of "a series of unfortunate events": 1) Old
|
No haven't been jumping versions. Just updated from 9.20.4 Will try 9.21.2 |
Okay, what was the version of |
9.20.4 |
Hmm okay, in that case I don't know why it has worked before resp. why it stopped working after. |
The most seems to work, although I have one class that is extending on the BaseException I get the following error
|
Works if I don't extend on |
Glad to hear that it's working so far! I cannot reproduce this error on my end. Does it show up when you're running |
No it succeeds to build but comes up when starting directus. |
Strange! And you're using the official extension template ( |
Linear: ENG-127 |
Great idea! I think I even had this on my todo list at some point. We might also want to update the docs recommend using
That's exactly what it was meant for (I simply haven't had the time to implement it yet).
Another great idea 👍 |
I've been doing this through monkey patches. TBH I think this should be the default behavior in production, because if it's a core extension (for example something that processes events and does additional work) it does a lot of damage if they are not loaded and Directus still serves the requests. |
Fully agree, in gcp I added an alert to monitor for such error logs as extensions not loading so I can at least roll back asap |
Describe the Bug
After updating to 9.21.0 everything seemed to be fine, (ie. was able to build extensions etc) so we pushed into production, for about 72 hours now. Only now realised that none of the hooks (actions, filters) and custom endpoints have been working due to changes in the code structure. So even though there is a warning for each extension that couldn't load, the main app still works, but without any of the validation or custom logic implemented in code.
Believe it has something to do with #16374
To Reproduce
Try using
import { Accountability } from '@directus/shared/types';
in a custom extension and starting directus.Errors Shown
require() of ES Module /usr/node/app/node_modules/@directus/shared/node_modules/nanoid/index.js from /usr/node/app/node_modules/@directus/shared/dist/cjs/composables/use-custom-selection.js not supported.
What version of Directus are you using?
9.21.0
What version of Node.js are you using?
16
What database are you using?
mysql 8
What browser are you using?
chrome
How are you deploying Directus?
locally and gcp
The text was updated successfully, but these errors were encountered: