jeffeb3 / sandify

web based user interface to create patterns that could be useful for robots that draw in sand with ball bearings.
MIT License
187 stars 34 forks source link

"npm start" failing with "JSX syntax extension is not currently enabled" #278

Closed aaronse closed 10 months ago

aaronse commented 10 months ago

Am following https://github.com/jeffeb3/sandify#running-from-source-locally

"npm start" failing with "JSX syntax extension is not currently enabled.

Error message seems to include info on how to fix. Am new to vite, so figured on filing this issue for clarity...

"The esbuild loader for this file is currently set to "js" but it must be set to "jsx" to be able to parse JSX syntax. You can use "loader: { '.js': 'jsx' }" to do that."

aaronse commented 10 months ago

Hmm, maybe those messages are ignorable? Despite the scary errors during startup am still able to access the localhost:3000 app 🤷‍♂️ ?

image

bobnik commented 10 months ago

Yes, we have configuration settings in vite.config.js to handle that error, so not sure why are you seeing it.

What version of node are you using? We are at 20.6.1.

Are you using nvm for node versioning? If not, I recommend installing it, installing 20.6.1 if you don't have it, and then running "nvm use" from the project directory. Likely unrelated, but I see no warnings when running "npm start".

aaronse commented 10 months ago

Am on Node 18 still. Site still seems to work, will update to 20 if I run into a blocking issue, and/or when Node 20 reaches long term support https://nodejs.org/en/blog/announcements . Cheers for the info/guidance!

jeffeb3 commented 10 months ago

I use the docker compose. There important commands are in the docker compose file. So that should always have a working version of node and npm.