Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Issues at step 11 /public folder location #229

Open
yarnball opened this issue Sep 5, 2016 · 6 comments
Open

Issues at step 11 /public folder location #229

yarnball opened this issue Sep 5, 2016 · 6 comments

Comments

@yarnball
Copy link
Contributor

yarnball commented Sep 5, 2016

Hi,

After tutorial 11 of your tutorial, the project will only work locally. When I uploaded my project (upto step 11) to my webserver it gave a 403 error.

However, all tests before tutorial 11 worked fine.

When index.html is located on the root folder- it works fine.

I believe this is probably related to moving the index.html to /public.

Can you advise?

@jakeecolution
Copy link

No the issue is when you keep <script src="/bundle.js"></script>

You should switch it to <script src="/public/bundle.js"></script>

@jakeecolution
Copy link

#242 Check out my PR.

@mawansui
Copy link

@bryanj4 Thanks for the advice, man, worked like a charm. Note, though, that moving along with the tutorial, we:
a) Create the public directory
b) Move our index.html and index.css files there, as @yarnball has stated.

Which means it seems to be better to do the following:

  1. Add the <script src="/public/bundle.js"></script> after we make a first change to the webpack.config.js
  2. Then remove the /public part right in the end of the tutorial.

At least this is how I made it work. Hope anybody else will find this useful.

@smilingkylan
Copy link

I think I fixed it by changing ~line 12 of server.js to:

res.sendFile(path.join(__dirname, './public/index.html'))

@bondansebastian
Copy link

bondansebastian commented Dec 5, 2016

The output path of webpack.config.js before server.js is modified should be set to root folder, otherwise bundle.js will fail to load (in README.md)

@merriam
Copy link

merriam commented Mar 21, 2017

Also bug #218, fix #310

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

No branches or pull requests

6 participants