Skip to content
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

Cannot find module 'react-static-routes' on Windows #56

Closed
will-hart opened this issue Oct 18, 2017 · 4 comments
Closed

Cannot find module 'react-static-routes' on Windows #56

will-hart opened this issue Oct 18, 2017 · 4 comments
Labels

Comments

@will-hart
Copy link

Using version react-static 1.4.1 on Windows 10, I get an error on yarn build. It doesn't occur on yarn start.

D:\Code 
λ react-static create

? What should we name this project? test-www
? Select a template below... styled-components
=> Creating new react-static project...
=> Installing dependencies...

...

=> [✓] Project "test-www" created: 41882.103ms

=> To get started:

cd test-www

yarn start - Start the development server
yarn build - Build for production
yarn serve - Test a production build locally


D:\Code 
λ cd test-www

D:\Code\test-www  (react-static-starter@1.0.0)
λ yarn build
yarn build v1.0.0
$ react-static build

=> Copying public directory...
=> [✓] Public directory copied: 1.851ms
=> Building Routes...
=> [✓] Routes Built: 97.737ms
=> Bundling App...
=> [✓] App Bundled: 3563.956ms
=> Exporting Routes...
{ Error: Cannot find module 'react-static-routes'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:/Code/playbook-www/src/App.js:5:1)
    at Module._compile (module.js:624:30)
    at loader (D:\Code\playbook-www\node_modules\babel-register\lib\node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (D:\Code\playbook-www\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12) code: 'MODULE_NOT_FOUND' }
error Command failed with exit code 1.
@joostduecker
Copy link

I have the same problem with react-static 1.4.1 on Windows 10

@tannerlinsley
Copy link
Contributor

Unfortunately I don't have a windows machine to test this on currently, but the next release I'm working on has a whole new way of more reliably compiling those routes, so my guess is this will be fixed in the next release.

Stay tuned :)

@tannerlinsley
Copy link
Contributor

This should be fixed in the latest version. Please test by upgrading both your global and local packages to version 2.0.0.

@DanWebb
Copy link
Contributor

DanWebb commented Dec 29, 2017

Just a note for others searching for this issue, this error will appear on build if you install react-static-routes as a dependency. Don't run npm i -S react-static-routes.

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

No branches or pull requests

4 participants