Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Assets result in 404 with wrong path #24

Open
peter-neumann-dev opened this issue Jan 31, 2023 · 2 comments
Open

Assets result in 404 with wrong path #24

peter-neumann-dev opened this issue Jan 31, 2023 · 2 comments

Comments

@peter-neumann-dev
Copy link
Contributor

Reproduce
Include a file, for example with url() in SCSS, that will be added to the assets of builds (could also be a problem of assets outside CSS). Both in development mode and productions builds assets have the wrong path resulting in 404.

Example from a background-image:

  • Development: GET https://typo3-vite-demo.ddev.site/packages/typo3_vite_demo/Resources/Private/Images/bg.svg 404
  • Production: GET https://typo3-vite-demo.ddev.site/assets/bg-17e50649.svg 404

Possible solutions

  • use relative paths from source file
  • complete extension path, e.g. typo3conf/ext/typo3_vite_demo/Resources/Private/Images/bg.svg
@peter-neumann-dev
Copy link
Contributor Author

One solution for production build is to apply the base to the Vite config:
base: '/typo3conf/ext/typo3_vite_demo/Resources/Public/Vite/'

For development, additional configuration appears to be necessary…

@misterboe
Copy link
Contributor

That is the solution for develop:

#22 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants