Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Issue with react-hot-loader #457

Open
stephanpelikan opened this issue Jan 19, 2018 · 3 comments
Open

Issue with react-hot-loader #457

stephanpelikan opened this issue Jan 19, 2018 · 3 comments

Comments

@stephanpelikan
Copy link

stephanpelikan commented Jan 19, 2018

I'm using react-hot-loader for preserving component's state on HMR. This seems to work. But on the very first change after initial page load I get this error:

deepforceupdate-error

The change itself is applied and also state is preserved. Every further change runs without this error and is applied as well.

I tried using preact-deep-force-update

                resolve : {
                        alias: {
                                'react': 'preact-compat',
                                'react-dom': 'preact-compat',
                                'create-react-class': 'preact-compat/lib/create-react-class',
                                'preact-compat': 'preact-compat/dist/preact-compat',
                                'react-deep-force-update': 'preact-deep-force-update'
                        },
                        extensions : [ '.tsx', '.ts', '.js' ]
                },

but then the feature of preserving state is not and only pure HMR is working.

As you can see on the screenshot am even starting my project and I'm using preact for the first time. So I'm not sure the react-hot-loader is fully operational when I get this error. I hope you can tell me whether subsequent code of the function causing the error matters to preact HMR or you even can provide a workaround/solution for this issue.

Thx,
Stephan

By the way: I'm using Typescript and not Babel. But I don't think this matters at all.

PS: My dependencies are

    "dependencies": {
            "preact": "^8.2.7",
            "preact-compat": "^3.17.0"
    },
    "devDependencies": {
            "react-hot-loader": "^3.1.3",
            "preact-deep-force-update": "0.1.0",
            ....
@developit
Copy link
Member

I believe you need to use an older version of React Hot Loader, one that doesn't rely on Fiber internals.

@stephanpelikan
Copy link
Author

I used every version down to 3.0.0: Always the same result. The next version before is 1.3.0 but this version does not work at all.

They are heavily working on 4.0.0. Will this be compatible to preact? If not, do you have any plans regarding hmr and preact?

@developit
Copy link
Member

Not sure - as far as I'm aware, the RHL folks don't pay much attention to Preact.

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

No branches or pull requests

2 participants