Skip to content

vite ssr import 2 is not a function #77

@tomdavidson

Description

@tomdavidson

No error on build but when I make a request with the dev server, I get __vite_ssr_import_2__ is not a function in the console and the web browser never receives a response. Any ideas?

Basic app:

export const dispatcherApp = (req, res) => {
  const app = express();

  app.get("/", (req, res) => {
    res.send("change me to see updates, cloud functions!!");
  });

  app(req, res);
};

Config:

export default defineConfig({
  server: {
    port: 3000,
  },
  build: { ssr: false },
  plugins: [
    ...VitePluginNode({
      adapter: "express",
      appPath: "./src/index.ts",
      exportName: "dispatcherApp",
      tsCompiler: "swc",
    }),
  ],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions