Hej #emacs friends

I'm having an issue while trying to develop #TypeScript. All my tags say 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. I understand that when I'm importing react as a module that would be fine but that's not really what I want to do.

I've read that I should be able to solve this by adding "jsx": "react-jsx" to my tsconfig.json but that also doesn't seem to work.

Any help would be greatly appreciated.

@fabiooesch Tricky. It can sometimes be difficult to tell if the issue is emacs or if emacs is telling you something true about the toolchain, since the tool chain for building typescript is so hyperflexible.

You may want to confirm in your tsconfig.json file that you have typescript set to build in the mode you want it to---common JS versus that other option that I can never remember the name of.

@mark Thank you for your response. I've looked into it again and tried out some things. I realised that the problem only occurs in vite projects. When I create it as a "normal" react project everything is fine. Do you have any knowledge of how I could resolve it so the tsx-ts-mode also works vite projects? Or rather, why it doesn't work to begin with.

I'm not very knowledgeable when it comes to treesitter (or Emacs in general). I'd be grateful if you could nudge me into the right direction.

@fabiooesch Sorry, I'm afraid I don't have any experience with vite in general.

The next step I would take is to spin up a vite project and another project that works as expected with emacs and diff all the resulting files; that should at least reduce the set of things that could be different.