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.

Unable to resolve module Dimensions from

See original GitHub issue

Hello,

I get the following warning in the packager:

Unable to resolve module Dimensions from .... dist.js

Any idea how to fix that? Everything is working correctly, just the message in the packager.

Regards

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
PhilippKronecommented, Nov 19, 2015

Hi,

you can fix it by changing the following in dist/index.js:

from:

var _Dimensions = require('Dimensions');

var _Dimensions2 = _interopRequireDefault(_Dimensions);

var _Dimensions$get = _Dimensions2['default'].get('window');

to

var React = require('react-native');
var {
  Dimensions
} = React;
var {width, height} = Dimensions.get('window');

Regards Philipp

0reactions
hikmetskcommented, Jun 13, 2018

Do what @PhilippKrone said after restart packager. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

expo/Fastlane error: "unable to resolve module "Dimensions ...
This is the latest rejection stopping me from submitting my app to the App Store. I am in expo SDK 41. I have...
Read more >
unable to resolve module react-native-elements - You.com
This error means that either you haven't installed the react-navigation module or that you have installed the module but didn't re-built your project...
Read more >
[RESOLVED] Unable to resolve module
Hi All. I was looking for a "get location and display on map" component and found one. Link to the post in the...
Read more >
Unable to resolve module Dimensions from - Bountysource
Hello,. I get the following warning in the packager: Unable to resolve module Dimensions from .... dist.js. Any idea how to fix that?...
Read more >
react-native-tab-view issue#87 - Expo Snack
Dimensions, ... width: null, ... Error: Unable to resolve module 'react-native-tab-view.js' at Object.eval (react-native-tab-view.js:1:1 at eval ...
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