14 questions
0
votes
0
answers
861
views
Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
X.jsx:
import React from 'react';
function X() {
return (
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/...
3
votes
1
answer
472
views
How do I use an index (barrel) file without breaking react-refresh?
Say I have a module foo and it's got some stuff in it:
// foo/index.js
export { default as SomeComponent } from './SomeComponent'
export { someUtil } from './utilities'
export const SOME_CONSTANT = 42
...
1
vote
0
answers
420
views
Cannot find module '/React/node_modules/react-refresh/runtime.js'
I got the below error when deploying the code in cloud in local (windows) its working normally. When deploying in cloud I am getting following error:
** Uncaught Error: Cannot find module '/React/...
2
votes
0
answers
1k
views
How do I fix React Refresh?
I'm building a React app and I keep getting the same errors that I just can't fix:
Module not found: Error: You attempted to import server/reactweb/node_modules/react-refresh/runtime.js which falls ...
3
votes
0
answers
3k
views
react-refresh: OriginalFactory is undefined | Cannot read properties of undefined (reading 'call')
While trying to use moduleFederationPlugin from webpack, we are getting below error:
` Cannot read properties of undefined (reading 'call')
originalFactory.call(this, moduleObject, moduleExports, ...
1
vote
3
answers
207
views
React state from props that doesn't update (even doing destructuring and using different keys)
Sorry for the long question in advance but I have been struggling with this for some time
To give some context of what I am trying to accomplish I am loading this table when my app loads
And when I ...
12
votes
5
answers
18k
views
Compilation error due to (non-existant) import of react-refresh
We are currently working on a tiny app which just renders an external React component (external since it's npm installed). The purpose of this app is to just fetch some JSON configuration and pass ...
2
votes
1
answer
1k
views
'SocketClient is not a constructor' in react-refresh-webpack-plugin
I have a typescript react project where I try to add the react-refresh-webpack-client and get this error:
my webpack config:
import HtmlWebpackPlugin from 'html-webpack-plugin';
import UglifyJsPlugin ...
1
vote
1
answer
2k
views
How can I exclude React Refresh from the Create-React-App production build?
Uncaught Error: React Refresh runtime should not be included in the production bundle.
By default, when you do a npm run build, it changes the environment to 'production'. After looking at react-...
2
votes
0
answers
606
views
Basic hot reloading with webpack 5 not working properly
Issues
It is loading the entire page
Operating System: macOS Big Sur 11.2
Node Version: v14.15.4
NPM Version: 6.14.10
webpack Version: ^5.19.0
webpack-dev-server Version: ^4.0.0-beta.0
Browser: ...
1
vote
0
answers
250
views
React Hot Module Reload refresh when nothing updated
I'm using https://github.com/pmmmwh/react-refresh-webpack-plugin and it works good with react components. But sometimes I update a code that is not about a component directly and then I only see a ...
1
vote
1
answer
1k
views
Snowpack & React: hot reloading / refreshing not working
I use React with Snowpack and the react-refresh plugin.
After a change, the snowpack dev server recompiles correctly and the browser receives an HMR update signal - but the content is not reloaded, ...
0
votes
1
answer
964
views
Is there a way of printing on the browser console when React Fast Refresh finishes refreshing?
I tried to search here/Google/GitHub but I'm not even sure of how to look for this. No matter what words I use they will always show me results of how to implement HMR. But that's not my issue. I just ...
4
votes
0
answers
93
views
How to use react-refresh?
There is no much info about new react-refresh, and I'd like to start using it. There is no information about how to migrate from react-hot-reload.