Closed didymu5 closed 5 years ago
This issue is very likely caused by mixing Preact X with preact-compat
with the latter being specifically written for Preact 8.x. With Preact X the compat
package was moved into core. To resolve the situation do:
1) Uninstall preact-compat
2) Change preact-compat
aliasing to preact/compat
@marvinhagemeister Thanks I will try this! How did i totally miss that detail.
@marvinhagemeister That took care of my issue. Thanks.
I've set up
preact-compat
in a custom webpack config. I'm using webpack 4. Importing react and react-dom works without error. However when I'm importing a React based component I'm getting the following error:preact.module.js:1 Uncaught (in promise) TypeError: Cannot assign to read only property 'nodeName' of object '#<HTMLInputElement>
Sample code:
I've tried importing other react based components and still receive the same errors so I don't thing it's the third-party issue.
package.json
This is not a
preact-cli
set up project. I had to get a legacy project up to date and customized the preact-compat and so I had to manually set up the necessary preact configurations. I've tried an isolated project by setting up a preact-cli generated project and had no issues with importing react-based components. I'm guessing something is off with my configuration, but I'm not exactly sure. Any help is much appreciated.webpack alias: