Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions django_vite/core/asset_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ def get(self, path: str) -> ManifestEntry:
DjangoViteAssetNotFoundError: if cannot find the file path in the manifest
or if manifest was never parsed due to dev_mode=True.
"""
if path not in self._entries:
try:
return self._entries[path]
except KeyError:
raise DjangoViteAssetNotFoundError(
f"Cannot find {path} for app={self.app_name} in Vite manifest at "
f"{self.manifest_path}"
)

return self._entries[path]
) from None


class DjangoViteAppClient:
Expand Down Expand Up @@ -800,13 +800,12 @@ def _get_app_client(self, app: str) -> DjangoViteAppClient:
DjangoViteConfigNotFoundError: If app was not found in DJANGO_VITE
settings.
"""

if app not in self._apps:
try:
return self._apps[app]
except KeyError:
raise DjangoViteConfigNotFoundError(
f"Cannot find {app} in {self.DJANGO_VITE} settings."
)

return self._apps[app]
) from None

def generate_vite_asset(
self,
Expand Down