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

Using https with singleFetch causing error "Headers.set: ":method" is an invalid header name" #10445

Open
anhdd-kuro opened this issue Jan 29, 2025 · 1 comment

Comments

@anhdd-kuro
Copy link

anhdd-kuro commented Jan 29, 2025

Reproduction

What evert I use ( vite-plugin-mkcert, mkcert ... ) , the same error occur
Here is config files

import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import mkcert from "vite-plugin-mkcert";

export default defineConfig({
  plugins: [
    remix({
      ignoredRouteFiles: ["**/.*"],
      future: {
        v3_relativeSplatPath: true,
      },
    }),
    mkcert(),
  ],
  server: {
    port: Number(process.env.PORT || 3000),
  },
  ssr: {
  },
  build: {
    assetsInlineLimit: 0,
  },
});

or

import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import { createCA, createCert } from "mkcert";

const ca = await createCA({
  organization: "company",
  countryCode: "JP",
  state: "state",
  locality: "locality",
  validity: 365,
});

const cert = await createCert({
  ca,
  domains: ["127.0.0.1", "localhost"],
  validity: 365,
});

declare module "@remix-run/server-runtime" {
  interface Future {
    v3_singleFetch: true;
  }
}

export default defineConfig({
  plugins: [
    remix({
      ignoredRouteFiles: ["**/.*"],
      future: {
        v3_relativeSplatPath: true,
        v3_singleFetch: true,
      },
    }),
  ],
  server: {
    port: Number(process.env.PORT || 3456),
    // https://remix.run/docs/en/main/guides/local-tls
    https: cert,
  },
  build: {
    assetsInlineLimit: 0,
  },
});

System Info

"vite": "6.0.11",
"@remix-run/node": "2.15.2"

Used Package Manager

pnpm

Expected Behavior

Run normally

Actual Behavior

[vite] Internal server error: Headers.set: ":method" is an invalid header name.
@anhdd-kuro
Copy link
Author

For who get the same error with me

  server: {
    proxy: {},
  },

add proxy setting can temporary fix it

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

No branches or pull requests

1 participant