Skip to content

Webpacker 6: missing overlay errors (solved in webpack-dev-server 4) #2938

Closed
@tagliala

Description

@tagliala

edit: should be caused by webpack/webpack-dev-server#2786 and fixed in webpack-dev-server v4

edit2: I can confirm that with the main branch of webpack-dev-server and some edits to development.js, overlay errors are back


Hi,

I don't know if this is an issue with webpacker itself. With webpacker 5, I was able to see lint errors on the front-end, now I just get "failed to compile" error

How to replicate

  1. Create application
$ rails _6.1.3_ new test-webpacker6-webpack-dev-server --skip-active-record --skip-javascript
$ cd test-webpacker6-webpack-dev-server
$ echo "gem 'webpacker', git: 'https://github.com/rails/webpacker.git'" >> Gemfile
$ bundle
$ rails webpacker:install
$ sed -i '3i\ \ root "pages#home"' config/routes.rb
$ sed -i '10i\ \ \ \ <%= javascript_pack_tag "application" %>' app/views/layouts/application.html.erb
$ rails g controller Pages home
  1. Launch bin/webpack-dev-server
  2. Launch the server rails s and navigate to http://localhost:3000/
  3. Save application.js to check that hot reload works ("Hello World from Webpacker" appears in the console)
  4. Make a syntax error in application.js
  5. Save application.js

Before (Webpacker 5)

image

After (Webpacker 6)

image

I can still see errors in webpack-dev-server console

image

Ref: #2994

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