-
-
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
When using dev-server https option manifests and paths in CSS files are still http:// instead of https:// #903
Comments
Thanks for your detailed issue. I'm experiencing the same issue after upgrading to I tried to use the "allow-insecure-localhost" flag in Chrome, but that flag has been removed in Chrome 88. I found a workaround by setting |
I think we need to get rid of the "https" argument (parse-runtime.js#L44) as specified on webpack/webpack-dev-server /CHANGELOG.md#400-beta0-2020-11-27, the
Then we should not run the command |
Hi everyone! Thanks for the detailed report. I'm having some problems repeating the things here. First, the
So, if you pass To clarify: to use A) Continue passing the Encore.configureDevServerOptions(options => {
options.https = {
pfx: '/path/to/.symfony/certs/default.p12'
}
}) When doing this, everything seems to work for me. There may still be a bug somewhere - but I'm not able to repeat the issue where some paths in Cheers! |
Thanks for clarifying. That's exactly what I did, but it didn't work. But now it does. So either I was wrong and didn't do it that way, or some other magic (cache, other dependencies updated?) happened that made this problem disappear. |
Well, shamefully I must also admit that it works as @weaverryan wrote now. I am certain it wasn't a few days ago when I was reporting the issue, but whatever was causing wrong behavior is gone here too. Thanks for your time investigating and explaining expected behavior (couldn't find it in the docs) and I am closing the issue. |
Ok, this problem still exists. I think I've found the problem and the reason why both @Lustmored and I thought the problem has been solved magically.
With When you configure edit: well, this seems not 100% accurate, but I'm getting somewhere. |
Thank you @stephanvierkant for this explanation, I was also surprised by the fact that it works for both of you, and I spent too much time debugging and trying to figure out what was the cause of this issue at least for me, I even tried it with a new/clean installation of symfony and encore bundle, but I get the same results. Thank you again ! |
While I understand the problem, I don't know how to fix this. The I think we should get rid of the required https flag. @weaverryan WDYT? |
Thanks for digging deeper - the fact that the If we removed the So if we removed the |
Just my nitpick here, maybe that will help you everyone. I do use the dev-server with HTTPS enabled like this:
Encore.configureDevServerOptions((options) => {
options.https = {
...(options.https || {}), // not sure if it's needed in fact
cert: `${__dirname}/var/localhost.portfolio.yproximite.fr.pem`,
key: `${__dirname}/var/localhost.portfolio.yproximite.fr-key.pem`,
};
}) |
@weaverryan Yes, that sounds sensible. The https flag overrides the https options right now and that's how it should be. Just configuring https options (or just @Kocal That will create a manifest.json file with http:// isn't it? |
Nope, it create a Running {
"build/app.js": "https://my-domain:8080/build/app.js",
"build/page.home.js": "https://my-domain:8080/build/page.home.js",
"build/page.home.svg": "https://my-domain:8080/build/images/marker3.c5a075ce.svg",
"build/page.home.png": "https://my-domain:8080/build/images/full_hd_thumbnail_loading.ee5e651c.png",
"build/page.orphans.js": "https://my-domain:8080/build/page.orphans.js",
"build/page.project_details.js": "https://my-domain:8080/build/page.project_details.js",
"build/runtime.js": "https://my-domain:8080/build/runtime.js",
// ...
} |
Yea the |
Ok folks - I think #917 should fix this. Thanks for the detailed conversation here - it helped me jump into fix the issue instead of first jumping in to understand the issue. Cheers! |
Hi! This should be fixed in 1.0.5. If it's not, or you have any other issues, please open a new issue :). Related docs for the fix: symfony/symfony-docs#14930 So, enable const path = require('path');
// ...
.configureDevServerOptions(options => {
options.https = {
pfx: path.join(process.env.HOME, '.symfony/certs/default.p12'),
}
}) Then, do NOT use the
And have a lovely weekend ;) |
I have just spent a few hours trying to make dev-server serve files via SSL with .pfx specified (as per Symfony recommendation and personal preference), but I found no way around it. It looks to me like a bug in
webpack-dev-server
, but am not sure where to look for.I had set up in
packages.json
:Most options were easily migrated to
configureDevServerOptions
, but:options.https: { pfx: process.env.HOME + '/.symfony/certs/default.p12' }
and no--https
in command line, dev-server serves files with correct certificate. Butmanifest.json
,entrypoints.json
and paths in CSS contains paths withhttp://
, thus development app served via https cannot load any asset.options.https: { pfx: process.env.HOME + '/.symfony/certs/default.p12' }
or nooptions.https
at all, but pass--https
in command line, dev-server serves files with self signing certificate (ignoringpfx
configuration), but creates correct manifest.json, entrypoints.json and paths in CSS.Second options could be a short term solution for me (accepting new certificate once in a while is not that bad), but it would be nice to have working
pfx
option with manifest plugin. I see no way to pass pfx in command-line, which could probably solve the issue.The text was updated successfully, but these errors were encountered: