Skip to content

Unable to resolve module dimensions? #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Sep 20, 2015 · 7 comments
Closed

Unable to resolve module dimensions? #4

ghost opened this issue Sep 20, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 20, 2015

i am getting this error on the latest version of react native

"Unable to resolve module Dimensions from" then viewport-units.js

@ghost
Copy link
Author

ghost commented Sep 20, 2015

React Native 0.70+ introduced the need to use this instead

require('react-native').Dimensions

@jasecoop
Copy link

@jmstout This doesn't fix the issue for me, I still get this error on React-Native 0.14.2

jasecoop added a commit to jasecoop/react-native-viewport-units that referenced this issue Nov 18, 2015
@breadface
Copy link

I also get the same error

@altinselimi
Copy link

Me too. This should be fixed. (React v0.15)

rodrigoHime added a commit to rodrigoHime/react-native-viewport-units that referenced this issue Sep 17, 2017
This fixes the issue found here jmstout#4 (comment)
@paintedbicycle
Copy link

This is fixed if you apply the patch in PR# #5

@samkaraca
Copy link

Hi,

You can fix it by changing the following in viewport-unit.js:

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

after that restart packager

linuslyt added a commit to lablueprint/harmony-project that referenced this issue Apr 26, 2020
@zakaurehman
Copy link

i am getting this error on the latest version of react native

"Unable to resolve module Dimensions from" then viewport-units.j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants