This repository was archived by the owner on Jan 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 489
Cannot mix JS and TS in a single project #266
Comments
It was fixed in PR #242. Waiting for a drop. |
eanders-ms
pushed a commit
to microsoft/BotFramework-Emulator
that referenced
this issue
Apr 27, 2018
# Changelog * Put `devDependencies` to root, fixed `package-lock.json` * Removed unnecessary `devDependencies` * Please use `lerna add` from now on, don't use `npm install` or edit `package.json` * To add `jest` as `devDependencies` to `botframework-emulator-shared` package * At root, run `npm install jest --save-dev` followed by `lerna add jest --dev --scope=botframework-emulator-shared` * Please commit `package-lock.json` if you have any changes * Lerna [bug](lerna/lerna#1290) may cause unnecessary changes in `package-lock.json`, `#master` or `@3.0.0` will fix it * Until their next drop, please verify/tweak your changes in `package-lock.json` before committing the file * Bumped all dependencies to latest version * We are on latest `typescript@2.7.2` 🎉 * `electron@1.8.1` * `restify@4.3.2` (@6 now, but their plugins architecture changed) * Scoping internal packages with `@bfemulator` for CI/CD on our NPM feed * `/app/client` (`botframework-emulator-client`) is now `@bfemulator/client` * `/app/shared` (`botframework-emulator-shared`) is now `@bfemulator/app-shared` * Revisited all `.gitignore` files * Added `npm test` scripts to all `package.json`, by default, use `jest` * Temporarily added `react-app-rewired` to mix JSX in TypeScript React app (broken since `react-scripts-ts@>2.9.0`) * [Tracking bug](wmonk/create-react-app-typescript#266) at `react-scripts-ts`, their [next drop](wmonk/create-react-app-typescript#242) should have it # Notes Added few TypeScript ignores because: * Some typings are wrong (added `skipLibCheck`) * Some typings are outdated (using `any` type)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Uh oh!
There was an error while loading. Please reload this page.
Is this a bug report?
Yes.
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
"Mix JS and TS"
Environment
npm ls react-scripts-ts
(if you haven’t ejected): 2.13.0node -v
: 9.6.1npm -v
: 5.6.0yarn --version
(if you use Yarn):Then, specify:
Steps to Reproduce
(Write your steps here:)
create-react-app my-app --scripts-version react-scripts-ts
/my-app/src/App.tsx
toApp.js
npm run build
Expected Behavior
It should compile successfully. We should be able to write apps mixed with JSX and TSX. That's why in
tsconfig.json
, we setjsx
toreact
.Actual Behavior
It failed with:
This StackOverflow answer have some insights into the problem, by using
react-app-rewired
. By running thru JS/X files with Babel (without eject).Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: