Skip to content

There is no middleware created by adapter-node #2341

@bdadam

Description

@bdadam

Describe the bug

The readme in adapter-node linked from the svelte kit docs says:

The adapter exports a middleware (req, res, next) => {} that's compatible with Express / Connect / Polka. Additionally, it also exports a reference server implementation using this middleware with a plain Node HTTP server.
But you can use your favorite server framework to combine it with other middleware and server logic. You can import kitMiddleware, your ready-to-use SvelteKit bundle as middleware, from ./build/middlewares.js.

But I cannot find any middleware created by the adapter. I only have an index.js file in the build directory (besides the assets).

Is this an issue with the readme or with some configuration? Is there a way to get a middleware from adapter-node?

Reproduction

Repo: https://github.com/bdadam/svelte-kit-adapter-node-reproduction

The generated dist directory is also pushed to the repository.

Logs

No response

System Info

npx envinfo --system --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"

  System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.8.0 - ~/.volta/tools/image/node/16.8.0/bin/node
    Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
    npm: 7.21.0 - ~/.volta/tools/image/node/16.8.0/bin/npm
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.43 => 1.0.0-next.43 
    @sveltejs/kit: next => 1.0.0-next.160 
    svelte: ^3.34.0 => 3.42.4

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions