Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite not loaded on "/" route #31

Open
gresakg opened this issue May 14, 2024 · 0 comments
Open

Vite not loaded on "/" route #31

gresakg opened this issue May 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gresakg
Copy link

gresakg commented May 14, 2024

CodeIgniter version: 4.5.1
Package version: 1.1.1

Vite is not loaded it the route is defined as $routes->get('/', 'FrontPage::display');

Vite should be loaded on all but the excluded routes.

The bug is in Vite::routeIsNotExcluded()

If you explode an empty string, you get an array with one member containing an empty string. When you compare it to the output of the uri_string() function on the route defined as "/", the result is bool true , which resolves the function to bool false so the route gets excluded.

You should probably first check if VITE_EXCLUDED_ROUTES is empty and just return bool true and only explode it if not empty.

The issue #30 may be connected with this.

@gresakg gresakg added the bug Something isn't working label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant