laravel / telescope

An elegant debug assistant for the Laravel framework.

Home Page:https://laravel.com/docs/telescope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telescope is using the wrong assets in dev after migrating to Vite

wfern opened this issue · comments

Telescope Version

4.17.0

Laravel Version

10.29.0

PHP Version

8.2

Database Driver & Version

MySQL 8.0.31 for macOS 14.0

Description

Hello!

After migrating to Vite. When running npm run dev the Telescope assets also point to the dev server instead of the production compiled assets.

Of course if I run npm run build everything works fine.

Steps To Reproduce

Open telescope after running the npm run dev command.

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

Here is the repository: https://github.com/wfern/laravel-telescope-vite-bug-report

The only commit was just to install Telescope. Now just run npm run dev, open http://.../telescope and see that the assets are from "dev" and not those compiled from '/public/vendor/telescope'.

With npm run dev:
image

After npm run build and how it should be in dev too:
image

Reverted #1391

I'm having the same issue, both npm run dev and npm run build causes the same issue.

It's weird, because the upgrade to v4.17.0 works fine in another project I'm using. The only differences, seems to be multi-tenancy (I don't use this in working project with Telescope), but that's just speculation in my end, but it seems Vite is getting confused somehow/don't points to the correct endpoint.

@taylorotwell Thanks for the revert, hopefully it can be fully fixed. If more info is needed, please let me know. :)