Connected-react-router: BUG v6.6.0 window is no defined in nodejs environment

Created on 18 Nov 2019  路  7Comments  路  Source: supasate/connected-react-router

Upon a new deploy to heroku, I am getting the below error for my nodejs app utilizing connected-react-router

2019-11-18T03:09:55.179726+00:00 app[web.1]: ReferenceError: window is not defined
2019-11-18T03:09:55.179728+00:00 app[web.1]: at injectQuery (/app/node_modules/connected-react-router/lib/reducer.js:31:40)
2019-11-18T03:09:55.179730+00:00 app[web.1]: at createRouterReducer (/app/node_modules/connected-react-router/lib/reducer.js:64:17)

package.json has this:

"connected-react-router": "^6.3.2",

Resolution I did was just remove the ^ and good to go.

Most helpful comment

Fixed in v6.6.1.

All 7 comments

node_modules/connected-react-router/lib/reducer.js:31
  var searchQuery = location.search || window.location.search;
                                       ^

ReferenceError: window is not defined
    at injectQuery 

this is on [email protected]

this is not a problem with v6.5.2

experiencing same issue after upgrading

Same for me, downgrading to 6.5.2.

yarn add supasate/connected-react-router#pull/377/head

For those who live on the edge ;)

Fixed in v6.6.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abeledovictor picture abeledovictor  路  3Comments

dcs3spp picture dcs3spp  路  3Comments

AdrienLemaire picture AdrienLemaire  路  5Comments

alamchrstn picture alamchrstn  路  5Comments

nickvoronin-ellation picture nickvoronin-ellation  路  5Comments