Skip to content
New issue

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

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

Already on GitHub? # to your account

Problems with some kind of cache in hot-reload #882

Closed
eloff opened this issue Jan 9, 2019 · 4 comments
Closed

Problems with some kind of cache in hot-reload #882

eloff opened this issue Jan 9, 2019 · 4 comments
Labels

Comments

@eloff
Copy link

eloff commented Jan 9, 2019

I've been having very strange issues with razzle and hot reloading. Is there a cache it uses that I can clear? Sometimes the hot reloading will be working, and adding console.log shows up, but other parts of the code will not have updated so what's on disk and what I see in the browser is subtly different. Restarting razzle or the computer solves that problem. But I also see other wierd things that even seem to survive reboots. Case in point:

✅  Server-side HMR Enabled!
[HMR] Cannot apply update.
[HMR] Syntax Error: Unexpected )

GraphQL request (6:47)
5:             name
6:             buildings(status: "ACTIVE", sort: ) {
                                                 ^
7:                 data {

[HMR] You need to restart the application!
Running in development mode
🚀 started

> grep buildings src/queries/AvailabilityQueries.js
            buildings(status: "${BUILDING_STATUS.ACTIVE}") {

That dangling sort: comes from code I was working on yesterday, on a different branch. I've rebooted since then, I'm on a clean branch, and as you can see there's no dangling sort: on disk. So how is that error happening? I feel like this is a very clear example of the problems I've been having.

I managed to fix it by doing rm -rf node_modules && npm install. I'm a bit puzzled by why that worked, is there some kind of cache in the node_modules directory maybe?

os: Ubuntu 18.04
node version: v10.12.0
npm version: 6.4.1
razzle version: 2.4.0

Do you have any ideas about what might be going wrong? Thanks!

@jaredpalmer
Copy link
Owner

Can you create an example repo?

@jaredpalmer
Copy link
Owner

Pro tip you can write rs into the terminal and hit enter and razzle will restart the HMR server watcher

@stale stale bot added the stale label Mar 13, 2019
@brunomperes
Copy link

Not necessarily the same issue, but I was having similar symptoms: Restarting razzle wouldn't pick up new code that I had, and babel loader was complaining at the old code syntax (which wasn't there anymore).

Some digging showed that babel cache can be problematic Experience-Monks/babel-plugin-static-fs#7 and kentcdodds/babel-plugin-preval#19 (comment). But in my case purging node_modules didn't help.

What helped was to remove the build folder completely.

@stale stale bot removed the stale label Nov 4, 2019
@stale stale bot added the stale label Jan 3, 2020
@nimaa77
Copy link
Collaborator

nimaa77 commented Mar 17, 2020

Closed due to inactivity. Holler if this is a mistake, and we'll re-open it.

@nimaa77 nimaa77 closed this as completed Mar 17, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants