Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PropTypes is not defined

See original GitHub issue

Hi, I recently updated from 2.2.1 up to 17.1.2, and I’ve started getting errors like:

Uncaught ReferenceError: PropTypes is not defined

It seems that the plugin is not adding the import of PropTypes correctly, maybe? Or is there something else I’m missing? I’m on react 15.4.2, in case that matters.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

brigandcommented, Feb 19, 2018

That config option should probably be renamed to ‘forceESModules’ but the behavior is correct. The 'deadCode' option switches it to use require, and useESModules overrides that.

The useESModules option forces this plugin to output ES6 module […]

The import is added by this plugin, but maybe babel is detecting a duplicate import and removing the one we add from the final code? I don’t think this plugin is doing that check, but I’m not sure.

TrySoundcommented, Feb 19, 2018

It was removed in 16.0. In 15.5 it was just deprecated

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Proptypes' is not defined - Stack Overflow
I'm receiving the following linting error 'PropTypes' is not defined. (no-undef) . Here is the code that is causing the issue: import React,...
Read more >
propTypes is not defined · Issue #16288 · facebook/react-native
i want use proptypes in my react native- redux projects . but i got the error "propTypes is not defined. in this code:...
Read more >
[Solved]-'Proptypes' is not defined-Reactjs - appsloveworld
According to this issue comment. It appears to be because you have installed eslint 4.x when you should just use the eslint version...
Read more >
Don't Call PropTypes Warning - React
Don't call PropTypes directly. Using PropTypes in any other way than annotating React components with them is no longer supported: var apiShape =...
Read more >
How to Use PropTypes in React - freeCodeCamp
PropTypes are simply a mechanism that ensures that the passed value is of the correct datatype. This makes sure that we don't receive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found