# React + Typescript support (create-react-app with typescript template)

**URL:** <https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054>\
**Category:** Support\
**Tags:** deployment\
**Created:** [July 16, 2021, 3:06am UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054 "2021-07-16T03:06:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnllowe](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dnllowe/32/27615_2.png) [@dnllowe](https://answers.netlify.com/u/dnllowe)\
**Post date:** [July 16, 2021, 3:06am UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054/1 "2021-07-16T03:06:43Z")

</div>

Does Netlify not support a Webpack + React + Typescript stack? In my package.json, I have “ts-loader” and “typescript” listed as devDependencies, and run “npm i” before my build. However, I never see “ts-loader” or “typescript” installs show up in the logs, and when it comes time for webpack to build my React site, it complains:

“Module parse failed: The keyword ‘interface’ is reserved (4:0)”  
“You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.”

My guess is because “ts-loader” isn’t actually installed.

Any help here? Seems odd such a common stack wouldn’t work out-of-the-box. I’m using NODE\_ENV=development and see other devDependencies getting installed, just not the typescript-related ones. Also, this works fine locally.

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [July 16, 2021, 3:46am UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054/2 "2021-07-16T03:46:31Z")

</div>

Welcome to the forums @dnllowe

Have you tried adding these to as dependencies rather than devDependencies? You shouldn’t need to run `npm i` as dependencies are installed as per your `package.json`. As per [docs](https://docs.netlify.com/configure-builds/manage-dependencies/)

> Before running your build command, the buildbot will look for instructions about required languages and software needed to run your command.

Set your build command as `npm run build` (or whatever it is for your specific project) and away you go.

---

<div class="post-metadata">

**Author:** ![dnllowe](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dnllowe/32/27615_2.png) [@dnllowe](https://answers.netlify.com/u/dnllowe)\
**Post date:** [July 16, 2021, 4:11am UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054/3 "2021-07-16T04:11:19Z")

</div>

Thanks for the suggestion @coelmay.

No luck so far. Maybe my deployment setup is a little off the beaten path of what Netlify expects. I have a “server”, “app”, and “lib” folder in a monorepo–all of which are npm packages. Server is the express server, and the real entry point for everything. I tried including ts-loader here, but that didn’t help. Lib is a component library, which is one of the things that needs ts-loader and fails. App is the React app, which also requires ts-loader (but the build fails before getting here).

So my build script (from “server”) runs build for lib, then “app” installs “lib”, and builds. Then the output of that is consumed by “server”.

I’m guessing having multiple package.json files might be throwing things off. But I didn’t create a package.json at the root and included “ts-loader” and “typescript” in it, but still ran into the same webpack/typescript issues.

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [July 16, 2021, 4:23am UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054/4 "2021-07-16T04:23:09Z")

</div>

A server? Have a peruse over this.

> [@\[Support Guide\] Can I run a web server, HTTP listener, and/or database at Netlify?](https://answers.netlify.com/t/support-guide-can-i-run-a-web-server-http-listener-and-or-database-at-netlify/3078):
>
> Last reviewed: July 2025 How do I run a server/database at Netlify? We often get questions about how to run a specific backend server or database at Netlify. Examples of these types of questions include: How to I get my node HTTP listener to respond to requests? How do I start Mongo/MySQL/\<insert-some-database-here\> running on the server? How can I SSH into my website? We are here today to answer these questions - and the answer is: you can’t! hushed_faceWhat do you mean, I cannot run a …

---

<div class="post-metadata">

**Author:** ![dnllowe](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/dnllowe/32/27615_2.png) [@dnllowe](https://answers.netlify.com/u/dnllowe)\
**Post date:** [July 16, 2021, 7:22pm UTC](https://answers.netlify.com/t/react-typescript-support-create-react-app-with-typescript-template/41054/5 "2021-07-16T19:22:22Z")

</div>

Thanks again @coelmay – that put me on the right path.

For future Googlers, my steps to get it working:

1. Simplified my dependencies to be proper npm modules using [Github Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry)
2. Added a `.npmrc` file to my app and committed it, but used an environment variable `NPM_TOKEN` to reference the personal access token created for Github Packages (per [these](https://answers.netlify.com/t/accessing-private-github-package-registry/17199) forum [posts](https://answers.netlify.com/t/using-private-github-packages-with-netlify/6433))
3. Added a `_redirects` file in the `public` folder to handle React Routing [per the docs](https://docs.netlify.com/routing/redirects/).
4. Got rid of the Express.js server and everything works as expected, now.

Thanks!
