yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.79k stars 467 forks source link

django-admin collectstatic fails when used with ManifestStaticFilesStorage #1248

Closed iliakolev closed 2 years ago

iliakolev commented 3 years ago

django-autocomplete-light==3.9.0rc1 Django==3.2.3

STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"

raise ValueError("The file '%s' could not be found with %r." % (filename, self)) ValueError: The file 'vendor/select2/docs/plugins/highlight/css/pojoaque.jpg' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage

Note: There is no issue with django-autocomplete-light==3.8.2

p7996619 commented 3 years ago

I encountered a similiar issue when using Whitenoise for static files. It's not the same file, but from what I gathered, the docs folder in the select2 submodule (src/dal_select2/static/vendor/select2) seems to be the culprit. I don't think it should be included in the package. The error is gone if I manually delete this folder.

mrchrisadams commented 3 years ago

hi there. I'm also seeing an issue similar to this.

I'm using whitenoise.storage.CompressedManifestStaticFilesStorage as my static storage engine, and it seems that running ./manage.py collectstatic I don't see the select2.js files added to the generated set of static files.

If I fallback to the the default staticfiles storage the files are generated, and this works, but not when I switch back to the whitenoise.storage.CompressedManifestStaticFilesStorage storage engine.

Below here is the pipfile.lock I've been using:

https://github.com/thegreenwebfoundation/admin-portal/blob/ca-internal-labels-for-providers/Pipfile.lock

I'm ok to raise an issue in the whitenoise repo, but any pointers about resolution would be helpful, as I'm not really able to move away from whitenoise in production.

leetucker commented 2 years ago

I had the same issue, and removing the docs folder as described by @githubuserx solved the problem. Can this submodule link be updated in such a way to fix the issue?

jpic commented 2 years ago

I believe this is fixed in 3.9.0rc2 release, the submodule wasn't supposed to be there at all.

Please reopen if necessary.

michaelslec commented 2 years ago

Hello,

I'm still having this issue on the 3.9.1rc2 release. Same exact symptoms, and seemingly the same cause