I am using VS 2013 and tsx files with react. I can build my project manually just fine. (Right click and build solution)
But when I try to publish on Azure, VS tries to build again but at that time I am getting all bunch of errors stated as:
Error 2 Build: Cannot use JSX unless the '--jsx' flag is provided.
and points to my tsx files.
Seems like Azure Publish using different kind of build steps than VS 2013 does.
How can I fix this issue?
I added "jsx": "react"
to my tsconfig.json
to resolve this error:
{
"compileOnSave": true,
"compilerOptions": {
"target": "es6",
"outFile": "Content/app.js",
"sourceMap": true,
"jsx": "react"
}
}
Adding this to the csproj worked for me in VS2015:
<PropertyGroup>
<TypeScriptJSXEmit>react</TypeScriptJSXEmit>
</PropertyGroup>
From: Working around "Cannot use JSX unless the '--jsx' flag is provided." using the TypeScript 1.6 beta
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With