mipearson / webpack-rails

Integrate webpack with your Ruby on Rails application
MIT License
543 stars 82 forks source link

unexpected token at 'Cannot GET /webpack/manifest.json #58

Closed hazardco closed 7 years ago

hazardco commented 8 years ago

Hello,

I have a problem with this gem. I have created a simple project to test webpack-rails with a controller and a unique view. When i execute foreman start I get the following error: "unexpected token at 'Cannot GET /webpack/manifest.json"

I have:

I followed the installation instructions:

-Add webpack-rails to your gemfile
-Run bundle install to install the gem
-Run bundle exec rails generate webpack_rails:install to copy across example files
-Run foreman start to start webpack-dev-server and rails server at the same time
-Add the webpack entry point to your layout (see next section)
-Edit webpack/application.js and write some code

I have added "<%= javascript_include_tag *webpack_asset_paths("application") %>" to the layout.html.erb

¿Any solution?

Thanks!!

mipearson commented 8 years ago

A very recent new version of a dependency of webpack or webpack-dev-server is breaking manifest generation. I'm looking into this now.

mipearson commented 8 years ago

Workaround: add:

    "webpack-dev-middleware": "1.7.0"

to your package.json, run npm install && npm dedup

There seems to be an issue with stats-webpack-plugin & the latest version of webpack-dev-middleware.

juanca commented 8 years ago

Fixed in latest, see https://github.com/webpack/webpack-dev-middleware/pull/129

wemmick commented 7 years ago

I just installed this gem and am getting the same error:

784: unexpected token at 'Cannot GET /webpack/manifest.json
'

I'm on Rails 4.2.4, Ruby 2.2.2p95, Node 4.1.1

I tried adding the webpack-dev-middleware to my package.json dependencies, but am still getting the error. Any ideas? Or do you need more info from me?