Closed hfroot closed 1 month ago
I think that apps.get_app_config
expects the app label, but it is being passed the app name. In the case of wagtail, the app config is defined as the following:
class WagtailAppConfig(AppConfig):
name = "wagtail"
label = "wagtailcore"
If CONFIG["INSTALLED_APPS"] is necessary, would it be possible to get the paths from apps.get_app_configs()
? e.g
def get_apps(self) -> Dict[str, str]:
APPS={}
app_configs = apps.get_app_configs()
for app_config in app_configs:
name = app_config.name
if '.' in name or name == 'django_vite_plugin':
continue
APPS[name] = app_config.path
I wanted to open a PR but I am struggling to get my local environment setup. Figured I'd let you know in case there is something that can be added to the docs. I did the following steps:
forked the repository, checked that out locally cd example/output virtualenv -p python3 venv source ./venv/bin/activate pip install django_vite_plugin pip install Django python manage.py migrate python manage.py runserver
Which went fine, I struggled with the JS side...
npm install npm run dev
gives me
✘ [ERROR] Failed to resolve entry for package "django-vite-plugin". The package may have incorrect main/module/exports specified in its package.json. [plugin externalize-deps]
...
The plugin "externalize-deps" was triggered by this import vite.config.js:2:33: 2 │ import { djangoVitePlugin } from 'django-vite-plugin'
The docs say
In your
vite.config.js
file, change./django-vite-plugin/index.js
todjango-vite-plugin
but I don't see any instances of ./django-vite-plugin/index.js
in the codebase.
Hi, thanks for the plugin! It's very helpful, we managed to get a first version up and running.
We've now integrated wagtail into our project, and following the official documentation we have added
wagtail
to the list ofINSTALLED_APPS
.Except this causes an exception when trying to build or run vue 3.
LookupError: No installed app with label 'wagtail'. Did you mean 'wagtailcore'?
I don't get this exception when runningpython manage.py runserver
.I cannot change the app name in the list to
wagtailcore
. When I do I getModuleNotFoundError:
onpython manage.py runserver
.I can solve the issue if I comment out the line
CONFIG["INSTALLED_APPS"] = self.get_apps()
. But of course I don't know if that will break something later down the line, or whether this bug is a problem with wagtail rather than this plugin. What are your thoughts? Thanks in advance.The full stack trace: