FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

[BUG] Unable to use template @snowpack/app-template-react-typescript with babel #2976

Closed vitalybe closed 3 years ago

vitalybe commented 3 years ago

Bug Report Quick Checklist

Describe the bug

Unable to use babel in conjunction with typescript in @snowpack/app-template-react-typescript

To Reproduce

We can't fix bugs that we can't see for ourselves. Issues often need to be closed if this section is skipped.

[
  "@snowpack/plugin-babel",
  {
    "input": ['.js', '.mjs', '.jsx', '.ts', '.tsx']
  }
]
{
  "presets": ["@babel/preset-typescript"],
}
index.js: Support for the experimental syntax 'jsx' isn't currently enabled (5:17):

  3 | import App from './App';
  4 | import './index.css';
> 5 | ReactDOM.render(<React.StrictMode>

I've pushed a reproduction repo here:

https://github.com/vitalybe/react-snowpack-typescript-babel

Expected behavior

Expected I could use babel (specifically I'm trying to use babel macros for styled-components).

FredKSchott commented 3 years ago

Sorry, but we can't provide framework/tool specific troubleshooting in this issue tracker. My best guess is that Babel needs a react plugin/preset in your babelrc to work.