React-native-router-flux: No dimension set for key window

Created on 2 May 2017  ·  58Comments  ·  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v3.38.1
  • react-native v0.44.0
  • android device

Problem

After installing react-native-router-flux app crashs.The error is that "No dimension set for key window".I didnt import router but its crash app.

Most helpful comment

I tried @Chandhru08 solution but I get this red error screen when running the app ({"type":"InternalError", ...}) and in the terminal:

Loading dependency graph, done.
error: bundling: Error: ENOENT: no such file or directory, open '/Users/xxx/Desktop/testApp/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js'

All 58 comments

+1

+1

@atmortensen Reverting to 3.38.0 generates a new error

-- [email protected] -- UNMET PEER DEPENDENCY react@^0.13.0 || ^0.14.0 || ^15.0.0

I _think_ this is because react-native-router-flux 3.38.0 depends on react-static-container 1.0.1 which depends on react ^0.13.0 || ^0.14.0 || ^15.0.0, but react-native 0.44.0 depends on react 16.0.0-alpha.6

I followed @ThiagoLottici solution in comment from issue #1811 in which he references #1710 as a workaround. This worked for me with version 3.38.0.

i am having the same issue :(

I have the same issue, it is pain.

I've "downgraded" to "^3.38.0", and it has worked:

"dependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.0",
    "react-native-router-flux": "^3.38.0"
  },

im having the same problem :
-- [email protected] +-- UNMET PEER DEPENDENCY react@^0.13.0 || ^0.14.0 || ^15.0.0 -- [email protected]
`-- [email protected]

"dependencies": {
"firebase": "^3.9.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-router-flux": "^3.38.0",
"redux-thunk": "^2.2.0"
}

+1

Happens to me as well on a clean react-native project on iOS device.

Version

Tell us which versions you are using:

  1. react-native-router-flux v3.38.1
  2. react-native v0.44.0
  3. react 16.0.0-alpha.6

I am experiencing the same problem. Strangely enough the same project works on my Mac with run-ios, but after bringing the project to my PC and running run-android I started getting this issue.
Here is my package.json:

"dependencies": {
    "firebase": "^3.9.0",
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.0",
    "react-native-router-flux": "3.38.0",
    "react-redux": "^5.0.4",
    "redux": "^3.6.0",
    "redux-thunk": "^2.2.0"
  },

I got it worked by following below steps.

1.Remove the "^" symbol from dependencies in package.json.
It should be like this "react-native-router-flux": "3.38.0"

  1. Install v 3.38.0.

Even though some warning are thrown after this step, it is working for me.

@lastxtemplar have you installed react-native-router-flux 3.38.0 after removing "^" from dependencies?

@Chandhru08
Your solution is not working for me. It is my dependencies:

"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-localization": "^0.1.30",
"react-native-router-flux": "3.38.0"
},

After remove _node_modules_ folder I perform npm install and I see:
-- [email protected] +-- UNMET PEER DEPENDENCY react@^0.13.0 || ^0.14.0 || ^15.0.0--

Could you please provide your package.json.

I tried @Chandhru08 solution but I get this red error screen when running the app ({"type":"InternalError", ...}) and in the terminal:

Loading dependency graph, done.
error: bundling: Error: ENOENT: no such file or directory, open '/Users/xxx/Desktop/testApp/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js'

Please fix asap

Damn @Anima-t3d im getting the exact same error!!! any solution yet? This dependency broke my app, i can't even make it work without that react-native-router-flux that packager still tries to grab a file from that directory! when it DOESN'T exist!!!

Take a look at https://github.com/facebook/react-native/issues/13758. Particularly at the commentaries from @rkbhochalya and @mattdufeu. Check if you have other projects running (or were running on the same session - because rebooting solved for me).

If you have yarn installed this would be much faster watchman watch-del-all && rm -rf node_modules/ && npm cache clean && yarn install && npm start -- --reset-cache

I needed to restart my Mac and to run the commands provided by @rkbhochalya and now its working with the following deps in my package.json:

"dependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.0",
    "react-native-router-flux": "^3.38.1"
}

@valerybodak please find my complee JSON text below,
note: after installing react native router flux again the "^" symbol replaced automatically
{
"name": "manager",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"firebase": "^3.9.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-router-flux": "^3.38.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"eslint-config-rallycoding": "^3.2.0",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}

I have removed "^" before installing react native router flux.
To install specific version-> npm install --save [email protected]
(some warnings may occur... ignore those

If you run android application after installing this, it will work

the same question . it not work when i try above method. first project is work but other is not work

i have done @Chandhru08 and @rkbhochalya steps. It is not working. I am working on windows.

Instead this command
watchman watch-del-all && rm -rf node_modules/ && npm cache clean && yarn install && npm start -- --reset-cache
I do
rd /s /q node_modules && npm cache clean && yarn install && npm start -- --reset-cache

The error is still no dimension is set for key window. I wonder why.

My package.json as below.

{
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.0",
    "react-native-router-flux": "^3.38.0",
    "react-redux": "^5.0.1",
    "realm": "^0.15.4",
    "redux": "^3.6.0",
    "redux-persist": "^4.0.0-alpha7",
    "redux-thunk": "^2.1.0",
 }

@rahmanazhar have you tried deleting the yarn.lock before running yarn install? Or running npm iinstead?

React-Native v .45 will work with flux-router 3.38+ but its not released yet.

Until then, use version 3.37.0 and make sure your in package.json file it looks like this
"react-native-router-flux": "3.37.0",
Notice that I removed the ^ symbol from the version number. This step is very important as the symbol forces npm install to look for the newest version instead of the version indicated. Cheers!

@jpca999 change "react-native-router-flux": "^3.38.0", to "react-native-router-flux": "3.37.0",
then delete and reinstall node_modules

@wvicioso
Here's my updated package.

{
"name": "manager",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"firebase": "^3.9.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-router-flux": "3.37.0",
"react-redux": "^5.0.4",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}

Now the app doesnt even open on simulator.

@jpca999 Make sure you close the all processes including the packager and delete and reinstall your node-modules. You can do that by running this command rm -rf node_modules && npm install then do react-native run-ios or react-native run-android depending on which you're building for.

"Make sure you close the all processes including the packager"
Packager means all terminal processes - right ?
I quit the whole terminal.

this I hit cmd q
image

Yes. Also very important you delete your node modules folder before you run
npm install. Share the error your get if the problem persists and let me
know if you're getting the problem on iOS or Android

On Tuesday, May 9, 2017, jayp notifications@github.com wrote:

"Make sure you close the all processes including the packager"
Packager means all terminal processes - right ?
I quit the whole terminal.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aksonov/react-native-router-flux/issues/1832#issuecomment-300277674,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AS3KkUKdhDk1hGbFEG6jq06FW9x92LFKks5r4MASgaJpZM4NOmSB
.

hmm i do delete the whole node modules folder, & then npm i
I'm running on ios.
Thanks: )

Here's the error:

image

{
"name": "manager",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"firebase": "^3.9.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-router-flux": "3.37.0",
"react-redux": "^5.0.4",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}

the app wouldnt even open, after i click it , it just closes in 2 seconds.

image

image

It's a package issue not my code issue

Give me a pcakcage file that works for other people...

@wvicioso

resolved here https://github.com/aksonov/react-native-router-flux/issues/1816
"react": "16.0.0-alpha.6",
"react-addons-pure-render-mixin": "15.5.2",
"react-native": "0.43.3",
"react-native-router-flux": "3.38.0",
"react-static-container": "^1.0.1",

so you downgraded the react-native version. that's intersting. My projects use react-native .41 and flux-router 3.37

+1

Resolved, just try changing the versions

On May 10, 2017, at 7:59 PM, Diego Rodrigues Vieira notifications@github.com wrote:

+1


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@jpca999 now I'm using react-native 0.44 and the error still happens

+1

@aksonov - Is this repo no longer maintained? I am having the same issues and have tried some suggestions from this feed with no success.

It seems to me that this project is not being maintained, I am now using react-navigation...

How's it working out ?

On May 12, 2017, at 8:43 AM, Diego Rodrigues Vieira notifications@github.com wrote:

It seems to me that this project is not being maintained, I am now using react-navigation...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Latest versions of RN are not supported yet. I will take a look it but have limited available time. PR is welcome

12 мая 2017 г., в 16:30, jayp notifications@github.com написал(а):

How's it working out ?

On May 12, 2017, at 8:43 AM, Diego Rodrigues Vieira notifications@github.com wrote:

It seems to me that this project is not being maintained, I am now using react-navigation...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Same here for react-navigation https://reactnavigation.org/

it work after i restart pc;

I had this issue on a clean react-native project, I don't even use flux.

It happened when I switch to another react-native project and back. I fixed by killing emulator, terminal, Xcode, remove node_modules and it worked.

Have You tried kill all background-running "react-native packager" processes and npm start --reset-cache again?

The same issue.

image

I'm configuring now our IOS Platform, unfortunately I'm encountering with this issue.

@Ethan0007 : any luck fixing it? I'm stuck on the same issue , tried everything suggested

@airman00 yes sir, if you're configuring IOS please set your Dimensions.get('window'); instead of Dimensions.get('screen');

Himm I tried replacing all Dimensions.get('window') with Dimensions.get('screen'), now I just get this error
No dimension set for key screen', reason: 'Unhandled JS Exception: No dimension set for key screen
I also tried replacing all Dimensions.get('screen') were Dimensions.get('window') and that just gets you
No dimension set for key screen', reason: 'Unhandled JS Exception: No dimension set for key screen

Any ideas what to try next?

make sure that you replace them all. then try to npm start --reset-cache

Sorry, to be clear - you replaced all Dimensions.get('window') with Dimensions.get('screen') for your solution?

Or you replaced all Dimensions.get('screen') with Dimensions.get('window') for your solution?

replace Dimensions.get('screen') with Dimensions.get('window') if you are configuring IOS.

Was this page helpful?
0 / 5 - 0 ratings