yyx990803 / resolve-type-test

20 stars 2 forks source link

JSX: unable to recognize components #3

Open bitsnaps opened 1 year ago

bitsnaps commented 1 year ago

Hi Evan,

Just forked the repo and opened it on stackblitz, I got an issue with JSX isn't working as expected:

[plugin:babel] /home/projects/github-nyg5sh/test.tsx: Unexpected token, expected "</>/<=/>=" (6:17)
  9 |   );
/home/projects/github-nyg5sh/test.tsx:6:17
4  |    return () => (
5  |      <div>
6  |        <CompProps str="fesfef" alsoStr="ok" /> <hr />
   |                   ^
7  |        <CompEmit msg="hello" onTest={() => alert('test')} />
8  |      </div>

Looks like an issue with babel-plugin-resolve and/or babel-plugin-jsx, have you done any thing special in your environnement ? Does Vue play nice with JSX ?

Z3rio commented 1 year ago

+1, This also seems to be happening when I test it. The issue does not seem to be in this repo's code (since its the same format as vue's docs) I would assume its an issue with the babel setup here