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

Degraded developer experience / HMR consistently causing Log In screen to show. #886

Open
nboliver-ventureweb opened this issue Nov 18, 2024 · 6 comments

Comments

@nboliver-ventureweb
Copy link

Every change to a component is causing the log in screen to show. After a hard refresh, things work as expected until the component is saved again. The component is a form that uses forwardRef and is shared by multiple routes. Changing code in the route files does not cause the log in screen to show.

Image

@nboliver-ventureweb
Copy link
Author

Today I am frequently getting a Cloudflare tunnel error, which can be corrected with a hard refresh. Between that and the Log in screen, development is pretty slow and the Dx is not great. I am enjoying the app stack, but it seems like there's a few things to iron out to make it effective.

Image

@nboliver-ventureweb nboliver-ventureweb changed the title HMR consistently causing Log In screen to show Degraded developer experience / HMR consistently causing Log In screen to show. Nov 20, 2024
@nboliver-ventureweb
Copy link
Author

Any update here? Development is painfully slow when every save results in a login screen, which then requires a full page refresh...

@nboliver-ventureweb
Copy link
Author

nboliver-ventureweb commented Dec 6, 2024

It looks like there are two separate issues causing the login screen to show, and it might actually be related to #599 .
One is this: https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports. I had a Zod schema that is located in a component file that was being unnecessarily exported. Perhaps it could be beneficial to add the linked eslint plugin? https://github.com/ArnaudBarre/eslint-plugin-react-refresh

The other thing seems to pop up randomly - the logs show that shop is missing:

10:01:14 │      remix │ [shopify-app/DEBUG] Missing or invalid shop, redirecting to login path |
{shop: null}
10:01:14 │      remix │ [shopify-app/DEBUG] Authenticate returned a response
10:01:14 │      remix │ [shopify-app/DEBUG] Missing or invalid shop, redirecting to login path |
{shop: null}
10:01:14 │      remix │ [shopify-app/DEBUG] Authenticate returned a response

@vincaslt
Copy link

vincaslt commented Dec 7, 2024

Have you had success applying the eslint rule in a useful way? Remix routes export a bunch of non-component exports (loaders, actions etc.) so it's highlighting more than just problematic exports.

@nboliver-ventureweb
Copy link
Author

@vincaslt yeah if you look lower down the docs page for the plugin, there is an example of using allowExportNames with Remix: https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#allowexportnames-v044
In my config I also added handle to the list of allowed names.

@lizkenyon
Copy link
Contributor

Hi there 👋

Thank you for your patience on this!

I was able to reproduce this, it is seems like the redirection to the login screen happens when vite does a full page reload and triggers a document request. Because the document request is not initiated from the Shopify admin, it is missing the required shop parameter which is why you are then getting kicked over to the login screen.

We are going to continue to try to determine the best solution here. Thanks!

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

No branches or pull requests

3 participants