preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
950 stars 148 forks source link

When I use inline-react-svg, it occur error `Uncaught TypeError: Cannot convert a Symbol value to a string` #519

Closed ohute-couture closed 5 years ago

ohute-couture commented 5 years ago

Hi,

I want to use babel-plugin-inline-react-svg But, preact-compat occur error It is same when I use parcel-plugin-svgr

props.js:60 Uncaught TypeError: Cannot convert a Symbol value to a string
    at w (props.js:60)
    at g (props.js:15)
    at A (index.js:260)
    at _ (index.js:154)
    at _ (index.js:140)
    at d (children.js:74)
    at A (index.js:263)
    at _ (index.js:154)
    at d (children.js:74)
    at _ (index.js:44)

image

I am using preact, TS, parcel I think, props undefined makes error fix this please ..

marvinhagemeister commented 5 years ago

Do you have a repository or codesandbox where we can reproduce the issue you are experiencing? This helps us tremendously in fixing bugs👍

ohute-couture commented 5 years ago

You can check the code https://github.com/ohute-couture/preact_code_sand_box and check console.error https://ohute-couture.github.io/preact_code_sand_box/ (open dev tool)

when I made code sand box, I found it makes error if next element have a style property check this

marvinhagemeister commented 5 years ago

@ohute-couture The issues you're seeing are caused by mixing Preact X with preact-compat for Preact 8.x.

To fix this issue:

  1. Uninstall preact-compat via npm uninstall preact-compat
  2. Change the aliasing in package.json to use the preact/compat import from Preact X:
"alias": {
  "react": "preact/compat",
  "react-dom": "preact/compat"
},
ohute-couture commented 5 years ago

Thank you very much!! 👏👏👏👏👏