Description
Describe the bug
I've done all the steps described on the Get Started page, changed the wordpressHost to my development URL but when I go and run the start command, everything seems to be working, but I can't see images or any resource in the front end, and I get the following error in the browser console
Access to script at 'http://localhost:5173/assets/main.js' from origin 'http://mysite.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
If I run the build command everything work alright.
To Reproduce
Steps to reproduce the behavior:
- Download the most recent copy of the theme
- Change the wordpressHost constant
- Run the start command
- See error
Expected behavior
Assets are visible on the front end
Desktop (please complete the following information):
- OS: MacOS 15.5
- Browser: Arc
- Version: 1.97.1 (63934) / Chromium Engine Version 137.0.7151.69
Additional context
- Running Node 20.16.0
- Using pnpm
- Using Laravel Valet
If I add the following to vite.config.js
server object it seems to work, but this is my first time working with Vite and Flynt, so I'm not sure if is okay to do this.
cors: {
origin: host,
credentials: true,
}