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

Enabling HTTPS is not working for astro preview #12880

Closed
1 task
sebthom opened this issue Jan 2, 2025 · 1 comment
Closed
1 task

Enabling HTTPS is not working for astro preview #12880

sebthom opened this issue Jan 2, 2025 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@sebthom
Copy link

sebthom commented Jan 2, 2025

Astro Info

Astro                    v5.1.2
Node                     v22.12.0
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             unplugin-yaml
                         @astrojs/sitemap
                         pagefind
                         astro-runtime-config
                         @playform/compress
                         @astrojs/mdx

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Enabling HTTPS via @vitejs/plugin-basic-ssl works for dev mode but is ignored for preview mode.

astro config:

import { defineConfig } from 'astro/config';
import basicSsl from '@vitejs/plugin-basic-ssl';

// https://astro.build/config
export default defineConfig({
  vite: {
    plugins: [basicSsl()],
  },
});

What's the expected result?

Preview mode also uses HTTPS when @vitejs/plugin-basic-ssl is configured.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-aymh1xh1

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 2, 2025
@ematipico
Copy link
Member

I don't think we have the mean to make this work in preview unless this is implemented inside Astro.

After the build, vite doesn't exist anymore, and so as the plugin.

This isn't a bug. I suggest you to open a new discussion and propose supporting https in preview command.

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants