Can't add extensions

hi,

I’m working on a directus project running on a VPS server, the admin backend works fine, i can manage the blog just fine. however i need to make a new module to manage some data.

Issue is no matter what i try, directus don’t even read the extension, i can’t see it running nowhere

  • on my computer i ran npm init directus-extension without issue
  • edited module and index to my need
  • npm run build
  • copied the index.js file to extensions/my-module folder
  • restarted directus

I even tried the bare module the command makes, and I never sees it, any idea why ? I even tried to paste the index.js and module.vue like the docs says but does not work either, i only see in the logs the extensions added via marketplace

running latest directus 11.9.3
thanks

Hi, share the file structure.

Make sure you copied over package.json along with the dist folder

I made a folder called directus-extensions-testmodule with package.json and a dist folder, located in /extensions

since you didnt setup, you should also check .env file if the EXTENSION_PATH https://directus.io/docs/configuration/extensions has been rewritten. Also make sure target folder structure is: /extensions/my-extension/package.json and /extensions/my-extension/dist/*.js

My .env is set to /extensions, this should work ? In the second screenshot i shared you can see the extensions folder has many sub-folders, they should be read by directus or like you mentionned i should write the explicit path to my module in the .env ? Thanks

3 Answers

3

hi, here is the file structure on root directus installation

and File structure under root/extensions

Is there a reason you didn't deploy with docker? https://directus.io/docs/self-hosting/deploying

i'm not the one who set up the server, so i can't answer this, everything works beside this issue

I see, i remember this folder structure from early days when running directus from source but can't really remember how extensions were handled that time. Maybe someone else can help solve this issue, but since docker is the only recommended deployment for self hosting now, i would recommend to port this over to a docker deployment.

i'va had to update from directus 9.x to the latest version, so maybe that's why you mentionned different file structure. When i started working on this project the VPS server here and the frontend using Nuxt hasn't been updated in two years also

My extensions config in .env