Hello, I made a clean install with Yarn and tried
react-static start... unfortunately I had this logs:
$ react-static start
=> Copying public directory...
=> [鉁揮 Public directory copied: 7.440ms
=> Building Routes...
=> [鉁揮 Routes Built: 283.673ms
=> Building...
=> [鉁揮 App serving at http://localhost:3000
Failed to rebuild.
./dist/react-static-routes.js
Syntax error: D:/projects/react-static/constraintsolver/dist/react-static-routes.js: Octal literal in strict mode (9:89)
7 | import src_containers_Post from 'D:\projects\react-static\constraintsolver\src\containers\Post'
8 | import src_containers_Blog from 'D:\projects\react-static\constraintsolver\src\containers\Blog'
> 9 | import src_containers____ from 'D:\projects\react-static\constraintsolver\src\containers\404'
10 |
11 | export default class Routes extends Component {
12 | render () {
any idea ?
Thanks !
I'm getting this on Windows as well because of the absolute import paths using backslashes. You can get it to run temporarily by changing
'D:\projects\react-static\constraintsolver\src\containers\404'
to
'D:/projects/react-static/constraintsolver/src/containers/404'
However as soon as react-static rebuilds it will revert to the backslash paths.
As this line generates paths with backslahes :
https://github.com/nozzle/react-static/blob/dff7e87e9d8d6a270fef9401337e29f3de507b7c/src/static.js#L283
While waiting for a fix on Windows, a temporary solution would be to replace backslashes by slashes in node_modules/react-static/dist/static.js, line 501 :
Add a .replace(/\\/g, "/") at the end of _path2.default.resolve(_paths.ROOT, template)
This should be resolved in the latest release by using path.join to create a relative path rather than an absolute one.