Not possible to use JSX #305
-
So I went ahead and created a project using the CLI.
Success. Added
Then I created a simple component called
But I get this error
So I install |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Interesting, i never tried adding a .babelrc which I'm gathering is messing it up for some reason. Do you need to? Generally if you just leave as is JSX works without changing anything. The example template that ships with the project uses JSX without touching anything unless Im misunderstanding you. You should never need/want to install the React ones even though babel default error messages tell you to do so. Did you have any issues running the CLI generated project before adding the babelrc? Looking a bit further, this CLI is forked from Create React App which doesn't generally allow config override without ejecting. I haven't seen an official docs suggesting this works. |
Beta Was this translation helpful? Give feedback.
-
@ryansolid Hey, I've tried it without I'm open to suggestions as to how I can setup Solid in other ways to get it working. It seems very interesting so I want to try it out. |
Beta Was this translation helpful? Give feedback.
-
I see. The Solid Hacker News Web Component example uses the CLI but admittedly a different template but I've never had any issues in this regard. I just did a clean install and see if I have any luck reproducing. The setup already does import out of the box between the test setup and the index importing in App.js. I had no problem importing the Box component. I tried it next to App and in nested folders and tried both Where are the components you are trying to import are located? I think that might be the problem. The CRA setup seems to only transpile the import Box from "./Box"
function App() {
return <Box />;
}
export default App; I also tried moving it nested like I hope this points things in the right direction. There are other starter templates you can clone down to give Solid a try. https://github.com/ryansolid/solid/blob/master/documentation/resources/projects.md#starters. Running |
Beta Was this translation helpful? Give feedback.
I see. The Solid Hacker News Web Component example uses the CLI but admittedly a different template but I've never had any issues in this regard.
I just did a clean install and see if I have any luck reproducing. The setup already does import out of the box between the test setup and the index importing in App.js. I had no problem importing the Box component. I tried it next to App and in nested folders and tried both
.js
and.jsx
extensions and still had no issue.Where are the components you are trying to import are located? I think that might be the problem. The CRA setup seems to only transpile the
src
folder (and nested folders). If your file is in fact in thesrc
folder then I mean …