Louxsdon / django-breeze

Django Breeze provides a minimal and simple starting point for building a Django application with Inertia and Vite with minimal or no configuration. Styled with Tailwind CSS.
MIT License
53 stars 5 forks source link

django-breeze create-app vue3 doesn't work out of the box #10

Open derek-adair opened 1 month ago

derek-adair commented 1 month ago

There is a reference to a static file the application cannot find. This almost made me give up on the project because I did this first. Probably want to get this cleaned up. It looks like there is a hard coded reference to a static file, removing this makes it work fine.

Cheers. Cool project.

6:44:38 AM [vite] Internal server error: Failed to resolve import "/django_breeze/django-breeze-logo.jpg" from "src/pages/index.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: /home/d/_tmp/breeze-test/myproject/src/pages/index.vue:16:56
  14 |  });
  15 |  import { createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode } from "vue";
  16 |  import _imports_0 from "/static/django_breeze/django-breeze-logo.jpg";
     |                          ^
  17 |  const _hoisted_1 = { className: "text-center h-screen flex justify-center flex-col items-center p-4" };
  18 |  const _hoisted_2 = { className: "lg:flex space-y-2 lg:space-y-0 lg:space-x-3 mt-3" };
      at formatError (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:44062:46)
      at TransformContext.error (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:44058:19)
      at normalizeUrl (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:41844:33)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:41998:47
      at async Promise.all (index 3)
      at async TransformContext.transform (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:41914:13)
      at async Object.transform (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:44352:30)
      at async loadAndTransform (file:///home/d/_tmp/breeze-test/myproject/node_modules/vite/dist/node/chunks/dep-b2890f90.js:55026:29)
Failed to resolve import "/django_breeze/django-breeze-logo.jpg" from "src/pages/index.vue". Does the file exist?
Louxsdon commented 3 days ago

Thanks @derek-adair I will look into that and fix it.