React-router: StaticRouter missing

Created on 30 Jan 2017  路  6Comments  路  Source: ReactTraining/react-router

Version

4.0.0-beta.2

Steps to reproduce

npm install
build with webpack

Result

ERROR in ./~/react-router/index.js Module not found: Error: Cannot resolve 'file' or 'directory' ./StaticRouter in /<PROJECT>/node_modules/react-router @ ./~/react-router/index.js 26:21-46

I looked at node_modules/react-router/index.js line 26 is var _StaticRouter2 = require('./StaticRouter'); however StaticRouter.js is not in the mode_modules/react-router directory after npm install.

Most helpful comment

Merged in #4389. Just needs a release and we'll be good.

All 6 comments

It looks like it could be caused by,

"files": [
    "Core.js",
    "MemoryRouter.js",
    "Prompt.js",
    "Redirect.js",
    "Route.js",
    "Router.js",
    "ServerRouter.js",
    "Switch.js",
    "index.js",
    "matchPath.js",
    "withRouter.js",
    "README.md",
    "umd"
  ],

in package.json, I noticed that StaticRouter.js is missing.

@wolfadex You can edit out the alpha version reference as this is beta related.
@mjackson It looks likes "ServerRouter.js" was never updated to "StaticRouter.js" Also, "Core.js" can be removed from that list.

Merged in #4389. Just needs a release and we'll be good.

Thanks, @wolfadex! So many things to remember before cutting a release...

@mjackson np it happens to all of us, just happy to be able to use it.

If you are eager to use the beta; you can move the missing file from node_modules/react-router to node_modules/react-router-dom, and rename ServerRouter.js to StaticRouter.js

Was this page helpful?
0 / 5 - 0 ratings