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
Local extensions loaded twice when included as package dependency #21926
Comments
I am also experiencing a similar issue since the release of Directus 10.10.x with the extensions marketplace. |
minor update, found a temp workaround for us: instead of declaring local extensions as |
In my particular instance, I am using the Sane Image Size plugin, but it does not appear on the newly developed Marketplace. Therefore, I am adding it as a dependency in my
...then my install script runs the following:
This allows me to keep the extension up to date with the current repository and exclude its files from my version controlled application. It was working great until the update which included the Marketplace was released. Now, the extension loads as expected as a |
@robinsonjohn hmm, I suspect that custom remove extension not being picked up might be a different bug. in the meantime, did you try moving (BTW, you can probably also symlink ( |
@echocrow Thanks for the suggestions. I had attempted to use a symlink, but Directus completely ignored the extensions as if they weren't there. I had to copy the files themselves in order to get it to work. I'll go back and attempt the |
That is to be expected if you're using docker as you cannot symlink between the container and host OS. So inside the container they really are not there 😄 |
Describe the Bug
When packaging extensions locally and listing them as dependency in
package.json
, Directus currently will load them twice.Background:
We've "installed" our local extension packages as dependencies in the Directus app package, so that our monorepo tooling (e.g. Turborepo) picks up on the extensions as dependencies, and knows to build those first before deploying Directus (e.g. to Directus Cloud).
Temp fix is to configure local Directus with e.g.EXTENSIONS_PATH="./null"
.Edit: Pointing the extensions path to an empty directory does bypass this issue, but also prevents extension auto reloading from working.
Edit 2: Another temp fix is to declare local dependencies as
optionalDependencies
ordevDependencies
. Repo tools like Turborepo will still pick up the dependencies for tasks, but Directus (checking onlydependencies
for extensions) will not double-load them.To Reproduce
./package.json
./extensions/my-extension/package.json
Then start Directus.
Expected:
INFO: Loaded extensions: my-extension
my-extension
in thedirectus_extensions
tablemy-extension
listed only once on/admin/settings/extensions
init('app.after', () => ...)
registered and fired onceActual:
INFO: Loaded extensions: my-extension, my-extension
my-extension
in thedirectus_extensions
tablemy-extension
listed twice on/admin/settings/extensions
init('app.after', () => ...)
registered and fired twiceDirectus Version
v10.10.4
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: