question-mark
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.

TypeError: Cannot read property 'getItem' of undefined

See original GitHub issue

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

I’m creating a new react-native project and when running it I’m getting the above error. The full error is:

TypeError: Cannot read property 'getItem' of undefined

This error is located at:
    in FlatList (at YellowBoxList.js:87)
    in RCTView (at YellowBoxList.js:79)
    in YellowBoxList (at YellowBoxContainer.js:36)
    in YellowBoxContainer (at YellowBox.js:147)
    in YellowBox (at AppContainer.js:104)
    in RCTView (at AppContainer.js:135)
    in AppContainer (at renderApplication.js:39)

Also, in my cmd I’m getting this error, related to the debugger:

None of these files exist:
  * debugger-ui\debuggerWorker.cff11639.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
  * debugger-ui\debuggerWorker.cff11639.js\index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
    at ModuleResolver.resolveDependency (C:\Presto\haveri\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (C:\Presto\haveri\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (C:\Presto\haveri\node_modules\metro\src\node-haste\DependencyGraph.js:287:16)
    at C:\Presto\haveri\node_modules\metro\src\lib\transformHelpers.js:267:42
    at Server.<anonymous> (C:\Presto\haveri\node_modules\metro\src\Server.js:841:41)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Presto\haveri\node_modules\metro\src\Server.js:99:24)
    at _next (C:\Presto\haveri\node_modules\metro\src\Server.js:119:9)

I’m using windows 10. I understand that it might be related to my system because usually people init a new react-native app and it’s wokring. But I cannot figure out what’s the problem and why it responds like that. If you have a direction on what should I do I’d be glad to try anything, just a few days ago it worked fine and seems like it’s out of the blue.

Thanks a lot in advance

React Native version:

0.62.2

Steps To Reproduce

react-native init newProject react-native run-android

Expected Results

Describe what you expected to happen.

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:12

github_iconTop GitHub Comments

12reactions
avinashlng1080commented, Jan 4, 2021

@kwoxer I actually need the @babel/plugin-proposal-class-properties as I’m using the @babel/plugin-proposal-decorators. Is there another solution to this issue?

11reactions
kwoxercommented, Jul 18, 2020

Had the same issue.

Just remove:

     "@babel/plugin-proposal-class-properties": "^7.10.4",
     "@babel/plugin-transform-flow-strip-types": "^7.10.4",

from devDependencies

and

     plugins: [
       ["@babel/plugin-proposal-class-properties"],
       ["@babel/plugin-transform-flow-strip-types",
         {
           "loose": true
         }
       ],
     ],

from babel.config.js

Now build new.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read properties of undefined ...
You have put "window" with a capital w . You can use the following: Using lowercase window. const lightThemeCheckbox = document.
Read more >
Cannot read property 'getItem' of undefined - LocalStorage Nuxt
Use mapState to define that store and as long as the "getItem" property is defined within that store, the error will be addressed....
Read more >
"Uncaught TypeError: Cannot read property 'getItem' of null ...
Android : Android Webview: "Uncaught TypeError : Cannot read property ' getItem ' of null" [ Beautify Your Computer ...
Read more >
ERROR TypeError: Cannot read property title of undefined
HEY, SET YOUR LIKE THERE ! ... Your browser can't play this video. ... Solved: ERROR TypeError : Cannot read property title of...
Read more >
Firebase initial error with React Native (Cannot read property ...
[Solved]-Firebase initial error with React Native (Cannot read property 'getItem' of undefined)-Reactjs ... I found a solution to my problem. It seems that ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found