TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

TSX files don't get compiled when using systemjs jspm.

Open GauSim opened this issue 10 years ago • 4 comments

Ahoi, Im providing the "jsx": "react" flag in the compilerOptions for systemjs in the config.js file of jspm. But the file don't get compiled, im always getting "Unexpected token <" Error, because of the jsx syntax. For normal *.ts-files everything is working fine. Compiling the tsx file with tsc works fine as well.

I have a repo with an example here: https://github.com/GauSim/jspm-typescript-jsx-react

GauSim avatar Dec 03 '15 23:12 GauSim

//CC @vladima, i thought that was fixed.

mhegazy avatar Dec 03 '15 23:12 mhegazy

the issue is we don't parse literal values out of typescriptOptions from configuration. if this line is replaced with "jsx": 2 it should fix the issue

vladima avatar Dec 04 '15 00:12 vladima

This has to be better documented somewhere, currently takes a little too much head scratching and researching to find that the only thing wrong with my setup is that "jsx" : "react" needs to be replaced with "jsx" : 2. Why?!

Edward-Lombe avatar Dec 08 '15 23:12 Edward-Lombe

Passing that code into the TypeScript compiler would have flagged the issue ;)

mhegazy avatar Dec 08 '15 23:12 mhegazy