Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

add undefined import tip to guide #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
- [`npm run build` fails to minify](#npm-run-build-fails-to-minify)
- [Moment.js locales are missing](#momentjs-locales-are-missing)
- [TypeError: Cannot read property _foo_ on undefined](#typeerror-cannot-read-property-foo-on-undefined)
- [Alternatives to Ejecting](#alternatives-to-ejecting)
- [Something Missing?](#something-missing)

Expand Down Expand Up @@ -2439,6 +2440,20 @@ To resolve this:

In the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.

### TypeError: Cannot read property _foo_ on undefined

When importing a module, you might need to use

```typescript
import * as foo from 'foo';
```

instead of

```typescript
import foo from 'foo';
```

## Alternatives to Ejecting

[Ejecting](#npm-run-eject) lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting if you have many similar projects. In such cases instead of ejecting we recommend to *fork* `react-scripts` and any other packages you need. [This article](https://auth0.com/blog/how-to-configure-create-react-app/) dives into how to do it in depth. You can find more discussion in [this issue](https://github.com/facebookincubator/create-react-app/issues/682).
Expand Down