MrBin99 / django-vite

Integration of ViteJS in a Django project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read Vite manifest file since 3.0.0

NGPixel opened this issue · comments

I updated my config to 3.0.0 but it seems unable to read the isDynamicEntry property on some entries in the manifest generated by vite.

It now throws a warning:

WARNINGS:
?: (django_vite.W001) Cannot read Vite manifest file for app default at /workspace/dist/manifest.json : <lambda>() got an unexpected keyword argument 'isDynamicEntry'
        HINT: Make sure you have generated a manifest file, and that DJANGO_VITE["default"]["manifest_path"] points to the correct location.

Okay, I found the issue. Previously, django-vite loaded manifest entry data into dicts. Now it loads that data into a NamedTuple named ManifestEntry. And the key isDynamicEntry wasn't explicitly supported in our ManifestEntry, so we "got an unexpected keyword argument". The linked PR will fix this and get us back to the original behavior we had in v2.

Follow up question, does django-vite need to do anything to support dynamic imports? I wouldn't think so, I think the JavaScript code should be able to handle it by itself. And I don't think we want preload tags on dynamic imports.

?: (django_vite.W001) Cannot read Vite manifest file for app default at /Users/acu/Work/octolo-up/static/manifest.json : ManifestEntry.__new__() got an unexpected keyword argument 'dynamicImports'
	HINT: Make sure you have generated a manifest file, and that DJANGO_VITE["default"]["manifest_path"] points to the correct location.

@Niicck there it is