Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve command not passing webpack devServer config to webpack-dev-server #1974

Closed
lewisharveydeveloper opened this issue Oct 21, 2020 · 19 comments
Labels

Comments

@lewisharveydeveloper
Copy link

lewisharveydeveloper commented Oct 21, 2020

reopening #1469

here are my dev dependencies:

"devDependencies": {
    "@babel/core": "^7.12.3",
    "@babel/preset-env": "^7.12.1",
    "@babel/preset-react": "^7.12.1",
    "babel-loader": "^8.1.0",
    "react-hot-loader": "^4.13.0",
    "webpack": "^5.1.3",
    "webpack-cli": "^4.1.0",
    "webpack-dev-server": "^3.11.0"
  }

my dev server details:

devServer: { contentBase: path.join(__dirname, 'dist'), compress: true, port: 9000 }

Command:
"start": "webpack serve --config ./webpack.config.js --mode development",

What is the current behavior?

i 「wds」: Project is running at http://localhost:9000/

i 「wds」: webpack output is served from undefined

i 「wds」: Content not from webpack is served from C:\Users\lehar\scaling-todo-app\dist

The first change i make reloads, any after that do not.
The only way i can see updates is by stopping and reserving, even refreshing the page doesn't show updates.

Steps to reproduce the behavior:

Define a devServer config in your webpack config file
Run webpack serve --config webpack.dev.js

@alexander-akait
Copy link
Member

Closing #1469 (comment)

@alexander-akait
Copy link
Member

alexander-akait commented Oct 21, 2020

No need to open an issue without additional information, I can't fix something somewhere

@lewisharveydeveloper
Copy link
Author

No need to open an issue without additional information, I can't fix something somewhere

@evilebottnawi Sorry i accidentally submitted. Please reopen and see details

@alexander-akait
Copy link
Member

@lewisharveydeveloper Please create reproducible test repo, can't reproduce locally

@lewisharveydeveloper
Copy link
Author

lewisharveydeveloper commented Oct 21, 2020

@evilebottnawi https://github.com/lewisharveydeveloper/scaling-todo-app

see test string in app.js.
when i change that string, i see the changes on first change, but no following changes

@alexander-akait
Copy link
Member

@lewisharveydeveloper you need to set target: 'web', we are working on fixes

@lewisharveydeveloper
Copy link
Author

@evilebottnawi set target to web and pushed changes to my shared repo. no change

@alexander-akait
Copy link
Member

You need hot: true also

@lewisharveydeveloper
Copy link
Author

lewisharveydeveloper commented Oct 21, 2020

@evilebottnawi
Thanks for quick responses,
set hot to true but no change unfortunately.
(pushed to repo)

@alexander-akait
Copy link
Member

I will look at the problem tmorrow

@lewisharveydeveloper
Copy link
Author

lewisharveydeveloper commented Oct 21, 2020

@evilebottnawi Thank you :)

i've added more detail on the issue. seems like it might be something to do with cache since i don't even see changes once i refresh the tab.

@alexander-akait
Copy link
Member

No problems, works fine

@alexander-akait
Copy link
Member

Screenshot from 2020-10-29 18-00-59

@tx-steven
Copy link

tx-steven commented Oct 29, 2020

@evilebottnawi I am having this same issue: 「wds」: webpack output is served from undefined. And my live reloading does not work. I can confirm that using target: 'web' gets live reloading to work but I still get the same message 「wds」: webpack output is served from undefined. Is target: 'web' a temporary solution? I'm seeing that this problem might be fixed in #1469 but it doesn't look like those changes are published in a new version yet.

@lewisharveydeveloper
Copy link
Author

lewisharveydeveloper commented Oct 29, 2020

@evilebottnawi i made a new folder and pulled my repo.
I ran npm install, and then npm start.
I still have the same problem, the first refresh works but no subsequent ones.

@alexander-akait
Copy link
Member

@tx-steven Yes, target: 'web' is a temporary solution

@lewisharveydeveloper still can't reproduce, all works fine

@alexander-akait
Copy link
Member

I want to close because I can't reproduce, there is not magic with new webpack serve, feel free to feedback

@alexander-akait
Copy link
Member

In original repo it doesn't work, because you have resolving problems, so webpack can't init HMR, problems with code === problems with HMR, nothing to do here

@alexander-akait
Copy link
Member

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

No branches or pull requests

3 participants