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

Step 11 tutorial missing step #218

Open

Description

@yarnball

Great tutorial! Thank you :)

Step 11 seems to be missing something. I keep getting the error:

Uncaught SyntaxError: Unexpected token < (bundle.js:1)

I'm pretty sure the cause is that it's missing:

publicPath: '/'

from webpack.config.js

  output: {
    path: 'public',
    filename: 'bundle.js',
    publicPath: '/'
  },

Activity

  1. timdorr commented on Aug 23, 2016

    @timdorr
    Contributor

    Yep, that looks to be a small oversight. Can you submit a PR to fix it?

  2. spik3s commented on Sep 26, 2016

    @spik3s

    Small fix, now that publicPath: '/' is declared, the snippet of code

    output: {
        path: 'public',
        filename: 'bundle.js',
        publicPath: '/'
      }
    

    contains also path: 'public' which should be declared later on in the tutorial. Otherwise, it will keep returning the Unexpected token < (bundle.js:1) error.

  3. smilingkylan commented on Oct 27, 2016

    @smilingkylan

    Thanks a ton for the heads-up guys.

  4. eurobob commented on Dec 7, 2016

    @eurobob

    the path: 'public' issue that spik3s pointed out is still an issue. Tripped me up at least

  5. dloret commented on Dec 8, 2016

    @dloret

    Correct, the issue persists if webpack.config.js is not amended in a similar way at this first step of booting a prod server:
    output: { /*path: "public",*/ filename: "bundle.js", publicPath: "/" },

    @spik3s: thanks.

  6. merriam commented on Mar 21, 2017

    @merriam

    To add a bit more information:

    1. The error is from Express not finding ./public/bundle.js because it is looking for ./bundle.js. It keeps looping back until it just tries to deal with index.html. See http://stackoverflow.com/questions/38743275/express-js-unexpected-token.

    2. Moving bundle.js from ./public to . will make the error disappear.

    3. One way to move bundle.js is not to put in the "path: 'public'" line until after this step. This also keeps the public directory from being created, which makes the next step of the tutorial break.

    The only remaining issue is updating the path in webpack .config.js is now listed twice, so those following the tutorial will still get stuck. Adding a PR.

  7. merriam commented on Mar 21, 2017

    @merriam

    If we apply PR #310, we can close #229, #242, #280, #282, #289, and #291. Everyone runs across this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions