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

[BUG] HMR not working for newtab #267

Closed
2 tasks done
keslert opened this issue Oct 19, 2022 · 11 comments · Fixed by #281
Closed
2 tasks done

[BUG] HMR not working for newtab #267

keslert opened this issue Oct 19, 2022 · 11 comments · Fixed by #281
Assignees
Labels
bug Something isn't working

Comments

@keslert
Copy link

keslert commented Oct 19, 2022

What happened?

I just started using plasmo for the first time, so hopefully, I'm not just doing something wrong, but I can't get live reload to work with the newtab. I only see my changes when I refresh. I've tried with 0.56.0 and 0.57.0-alpha.2.

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

(OPTIONAL) Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@keslert keslert added the bug Something isn't working label Oct 19, 2022
@louisgv
Copy link
Contributor

louisgv commented Oct 19, 2022

@keslert Thanks for the bug report! This is quite weird, I tested HMR with the new tab page very recently, and it worked. Could it be related to #264 ? I'm a bit busy this week, but will prioritize this and #264 once I'm free :)

In my extension, I have a combination of option/newtab/popup pages and HMR worked on all of them individually. Tho, I have yet to add a component module outside of the entry files. That might be the issue :d

@louisgv louisgv pinned this issue Oct 19, 2022
@louisgv louisgv self-assigned this Oct 19, 2022
@louisgv
Copy link
Contributor

louisgv commented Oct 19, 2022

@keslert can you provide the outline of your project and which file you changed to test HMR? For me, when I changed my newtab.tsx file, it HMR'ed the code on my page.

@keslert
Copy link
Author

keslert commented Oct 20, 2022

I followed the instructions to create a src folder where I have a newtab.tsx. That file imports a few other components from a components folder. Changing the newtab.tsx file or the components requires a refresh before I see the changes. I do see in the browser console that HMR is listening for changes. And I can see in the dev terminal that changes are being compiled.

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

I tested on Brave and actually faced this issue - it seems Brave is using a newer version of chromium build than Chrome (?) - I can now see the CSP issue surfacing - will experiment with dev CSP

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

Actually disregard the last msg - the HMR is sending events, however the HMR content itself was not found :d. ....

@keslert do you see any error on the console regarding ERR_FILE_NOT_FOUND ?

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

hmm, I'm seeing HMR not being applied if user refresh the new tab... wondering why?

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

After trying to navigate directly to the HMR proxy, it seems to work consistently now... It seems there is a trick to ensure the proxy stays up - the bgsw page that's serving the proxy must stay open - this page might likely be crucial - we can also use it to pipe logs #193 as well (?)...

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

It seems if user "hard-refresh" a page, the HMR broke. Likely due to killing of the service worker.

@louisgv
Copy link
Contributor

louisgv commented Oct 29, 2022

Thankfully, we can catch the proxy error and just do a soft-refresh. Fix is on the way!

@nebrelbug
Copy link

@louisgv this is still not working for me...

@louisgv
Copy link
Contributor

louisgv commented Dec 30, 2022

Just merged the PR and ramping up a release. Will get it out by tmr!

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

Successfully merging a pull request may close this issue.

3 participants