Skip to content
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

Error when starting Directus from version 10.6.2 and up #22

Closed
caklein opened this issue Oct 9, 2023 · 7 comments
Closed

Error when starting Directus from version 10.6.2 and up #22

caklein opened this issue Oct 9, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@caklein
Copy link

caklein commented Oct 9, 2023

Hello!

I hope this message finds you well. I would like to bring to your attention an issue I have encountered while using your incredibly valuable extension on Directus 10.6.2 (docker).

Upon attempting to start Directus for the first time, I encountered the following fatal error:

directus-custom-directus-1 | Error: Cannot find module 'axios'
directus-custom-directus-1 | Require stack:
directus-custom-directus-1 | - /directus/extensions/endpoints/resauce-image-scout/classes/Provider.cjs
directus-custom-directus-1 | - /directus/extensions/endpoints/resauce-image-scout/providers/giphy.cjs
directus-custom-directus-1 | - /directus/extensions/endpoints/resauce-image-scout/providers.cjs
directus-custom-directus-1 | - /directus/extensions/endpoints/resauce-image-scout/index.cjs
directus-custom-directus-1 | at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
directus-custom-directus-1 | at Module._load (node:internal/modules/cjs/loader:922:27)
directus-custom-directus-1 | at Module.require (node:internal/modules/cjs/loader:1143:19)
directus-custom-directus-1 | at require (node:internal/modules/cjs/helpers:121:18)
directus-custom-directus-1 | at Object. (/directus/extensions/endpoints/resauce-image-scout/classes/Provider.cjs:1:15)
directus-custom-directus-1 | at Module._compile (node:internal/modules/cjs/loader:1256:14)
directus-custom-directus-1 | at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
directus-custom-directus-1 | at Module.load (node:internal/modules/cjs/loader:1119:32)
directus-custom-directus-1 | at Module._load (node:internal/modules/cjs/loader:960:12)
directus-custom-directus-1 | at Module.require (node:internal/modules/cjs/loader:1143:19) {
directus-custom-directus-1 | code: 'MODULE_NOT_FOUND',
directus-custom-directus-1 | requireStack: [
directus-custom-directus-1 | '/directus/extensions/endpoints/resauce-image-scout/classes/Provider.cjs',
directus-custom-directus-1 | '/directus/extensions/endpoints/resauce-image-scout/providers/giphy.cjs',
directus-custom-directus-1 | '/directus/extensions/endpoints/resauce-image-scout/providers.cjs',
directus-custom-directus-1 | '/directus/extensions/endpoints/resauce-image-scout/index.cjs'
directus-custom-directus-1 | ]
directus-custom-directus-1 | }
directus-custom-directus-1 |
directus-custom-directus-1 | Node.js v18.17.1
directus-custom-directus-1 exited with code 1

It's worth noting that this error was not present in version 10.6.1, where everything was working flawlessly.

I kindly request your assistance in resolving this matter, as your extension has been an invaluable asset to our workflow, and we greatly appreciate your support in ensuring its continued functionality.

@shealavington
Copy link
Member

Hi 👋,

Thank you for raising this, I appreciate the time taken. I will take a look tomorrow.

Thanks

@shealavington
Copy link
Member

shealavington commented Oct 10, 2023

I can confirm the issue is there for Directus 10.6.2 and not for v10.6.1.
I will look into this and create an update for v10.6.2 shortly.

Looking through the changes for *.2, it appears that axios is no longer bundled into Directus by default (which this extension was hooking onto). Unfortunately, this won't be a quick fix, so I'll do what I can and update accordingly. 🪄

@shealavington shealavington added the bug Something isn't working label Oct 10, 2023
@shealavington shealavington self-assigned this Oct 10, 2023
@shealavington
Copy link
Member

This issue has been resolved in the latest release
I appreciate the time taken to raise this issue. 🍪

@caklein
Copy link
Author

caklein commented Oct 11, 2023

Thank you for your promptness!

I'm not sure if it's related, but I began encountering Error 500 when trying to select an image from any provider after updating both the plugin and Directus.

image

@shealavington
Copy link
Member

shealavington commented Oct 11, 2023

Thank you for your promptness!

I'm not sure if it's related, but I began encountering Error 500 when trying to select an image from any provider after updating both the plugin and Directus.

image

Interesting, I went through and checked all 4 providers with my keys, so it definitely works.

I don't suppose there were any errors out into the docker logs? I believe I've prefixed all of my errors with '🎨', it could help would out what the root cause is.

I do aim at some point to make the error logging more helpful. So I do apologise that it might not be the best for now, unfortunately time is tight 😅

I've just looked at triggerDownload, and the line that is failing is when it tries to post the image data to Directus. With that, it could be a docker permissions issue. — I had an issue myself (see issue comment) while mounting a storage directory, do you have an upload directory mounted to the host machine?

Something may have changed in Directus recently as I never used to have issues with mounting a directory.

@caklein
Copy link
Author

caklein commented Oct 13, 2023

Got this:
image

In my case, I did the following:

  • Clicked on "Browse Images" on a field configured as Image Scout.
  • The default search results were displayed correctly, and I selected an image by clicking on the image selector.
  • Clicked on "Save."
  • However, the message "Please wait while we process your request" continued to be displayed indefinitely.

I am using Directus 10.6.3.

@shealavington
Copy link
Member

shealavington commented Oct 13, 2023

Thanks for sharing the detailed information, as it helps alot.

Unfortunately, I can only think that there appears to be an issue on your side of things somewhere. I've tried to replicate the same setup as you, however, everything is working here (image attached ~2).

It appears that it might be failing during the process of posting the prepared data to Directus. Are you able to see if the request looks malformed in any way in the network tab? ~1

~1
image

~2
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants