-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
[Dev Server] CSS and JS files are not found anymore #941
Comments
Hey @aarongerig! If you look at these 404's, are they going to the correct hostname? Are they going to I'm not aware of an issue exactly like this... and your config looks pretty boring (in a good way - I don't see any problems). Cheers! |
Hi @weaverryan! Thanks for looking into it. Yes, they are going to the correct hostname. If I open By the way, I'm running my local website on a couple of docker containers (PHP, MariaDB, etc.), but I don't think that's the issue. If you ask me, it has something to do with the updated webpack-dev-server and/or webpack versions. |
I've the same problem, but devserver opens :8081 but css and js are linked to :8080 If I use
I'm using HtmlWebpackPlugin
|
I can confirm the following behaviour :
Workaround :
|
Does webpack-dev-server define a dynamic default for the port, finding an available port ? If yes, that might be the cause of the issue if encore is not aware of the actual port |
Oh yes with |
Hi everyone! Ok! It looks like possibly a few things are going on:
Can you elaborate? Which KavaScript problem?
@aarongerig I actually DO think this is related to your Docker setup (it may still be a bug in Encore, I'm no sure yet, but I think it's your Docker setup that is making you have the error and not others). When you go directly to And then if you access a real file: In other words, it should not point to your actual app. Is it possible that Cheers! |
With the option
|
|
Hi @weaverryan ! Yes, you are right. My problem is somewhat different. I've been trying out some things and this is the solution I came up with. I ended up NOT defining the port and therefore the webpack-dev-server started on |
hi @aarongerig :) Would you please share your final configuration?
For me encore dev-server runs and compiles but I can't access the files. Here is what the console says:
Symfony is accessible from |
Sure, here's my final configuration: https://gist.github.com/aarongerig/caad0ef67e498f2cb8e8cc1f35ca1754 Hope this helps – cheers! |
Thank you very much @aarongerig |
…ryan) This PR was merged into the main branch. Discussion ---------- Do not allow webpack-dev-server to find an open port Addresses on issue on #941 This disallows the "find an open port" feature in webpack-dev-server. This is unfortunate, as this is a nice feature of webpack-dev-server where if port 8080 is open, it will try 8081, etc. However, because we need to build a manifest.json file, we need to know what the port is for sure at Webpack config build time. Even going through the same async process of using the "find-port" package isn't really doable... as it would make the entire config generation async (this may be possible, but would change a ton of things in Encore & in userland `webpack.config.js` files). Cheers! Commits ------- da17b90 Do not allow webpack-dev-server to find an open port
I recently switched to
@symfony/webpack-encore:^1.0
. Unfortunately my webpack-dev-server functionality isn't working as expected anymore. Maybe it's due to wrong configuration, although I didn't change it (it worked in previous versions, e.g. v0.33).Here's my current configuration:
Very important to notice: With the
.bin/encore dev
command it works properly (I'm loading my files via the Webpack Encore Bundle => Symfony). With the.bin/encore dev-server --host localhost --port 2000
I get following errors in my console:Is there anything I'm missing or doing wrong? Thanks for any feedback!
The text was updated successfully, but these errors were encountered: