create-react-app: Cannot use `composite` tsconfig.json setting

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

typescript composite isolatedModules

Environment

  System:    OS: macOS 10.14.2
    CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  Binaries:
    Node: 11.4.0 - ~/.nvm/versions/node/v11.4.0/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v11.4.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
    Safari: Not Found
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

  1. Run yarn create react-app my-app --typescript
  2. add composite: true to tsconfig.json
  3. run yarn start, get Option 'composite' cannot be specified with option 'isolatedModules'. TS5053
  4. Remove isolatedModules line from tsconfig
  5. run yarn start, create-react-app re-adds isolatedModules and you get the same error

Expected Behavior

I could use the composite flag

Actual Behavior

I can’t use the composite flag

Reproducible Demo

Above steps will reproduce this, pretty trivial.

This is potentially equally as much a typescript issue, though this is not really big to me—i just want to be able to build all my packages in my monorepo in one command, rather than having a separate invocation of tsc --build for my website package. But thought I’d log the issue here.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 8
  • Comments: 36

Commits related to this issue

Most upvoted comments

This is still an issue and should not be closed

Shouldn’t be closed.

The issue still persist, it would be really nice to have the feature!

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This bot is such a troll.

This is not a bug report, it’s a feature request. Using CRA + TS for anything but the most basic project setup is not supported currently.

Any chance to enjoy a better CRA typescript support in the near future?

I am also looking for a solution to this issue. Current workaround: npm link the shared lib. Drawback: you need to manually compile the lib every time the code changes.

We still need it, thank you! 🧞‍♂️

This is still an issue, and would really like if this could be solved 🙏 !

This is still an issue and should not be closed

This is not a bug report, it’s a feature request. Using CRA + TS for anything but the most basic project setup is not supported currently. For composite projects in particular, there really isn’t much support in Webpack at all ATM (@ts-tools/webpack-loader, ts-loader, awesome-typescript-loader, etc.). It’s a complicated feature and no one has done the work to properly integrate it yet. So unless you’re using tsc, you’re out of luck.

Some other loaders can handle more complicated setups. E.g. @ts-tools/webpack-loader can do monorepos, but it has it’s own drawbacks that make it problematic (e.g. doesn’t play nice w/ downstream loaders).

It’s all a bit of a clustf*ck at this point and I’m hoping the TS build landscape looks a bit better in the next year.

Still a problem. Omar

On Sun, Aug 23, 2020 at 8:06 AM stale[bot] notifications@github.com wrote:

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/7147#issuecomment-678706471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAONU3W3LCJJJNUZB5FW5ELSCBFPXANCNFSM4HSBG7FQ .

still a problem Omar

On Sat, Jul 18, 2020 at 3:13 PM stale[bot] notifications@github.com wrote:

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/7147#issuecomment-660434658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAONU3QRXC5D4UII4UBWKOTR4E4QLANCNFSM4HSBG7FQ .

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

still a problem

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.