ngduc / react-setup

A Universal React Setup with i18n: Babel 6, Koa 2, React, React Router, React Transmit, React Bootstrap, React-intl, Mocha, Isparta, Webpack 2, Storybook, InlineCSS/PostCSS, ESLint, HTTPS & HTTP2.
MIT License
175 stars 16 forks source link

client.js is not found #19

Closed kenny1har closed 7 years ago

kenny1har commented 7 years ago

npm run dev is loading a 404 error client.js

different path for client.js

in the dev mode, client.js is located at /static/client.js in the production mode, the path become incorrect. /client.js

renderAppRouter.js

production

const output = Transmit.injectIntoMarkup(
  renderedHtml, reactData, [`${webserver}/client.js?${webpackHash}`]
)

dev

const output = Transmit.injectIntoMarkup(
  renderedHtml, reactData, [`${webserver}/static/client.js?${webpackHash}`]
)
ngduc commented 7 years ago

"in the dev mode, client.js is located at /static/client.js" => not correct. In DEV mode, it's loading /client.js from webpack server, for example: http://localhost:8199/client.js

in PROD mode, it's loading /client.js normally. I've just tried it works for me in both modes. Is it broken for you?

ngduc commented 7 years ago

image

kenny1har commented 7 years ago

client i did a clean clone from github. npm run dev

*windows 10 and ubuntu ... same problem

ngduc commented 7 years ago

Your path looks correct. I'm using a Mac. It works on multiple projects of mine. It could be something wrong with Webpack. If you find a solution, please let me know.

kenny1har commented 7 years ago

before: before

after: after