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

There is no middleware created by adapter-node #2341

Closed
bdadam opened this issue Sep 1, 2021 · 4 comments
Closed

There is no middleware created by adapter-node #2341

bdadam opened this issue Sep 1, 2021 · 4 comments

Comments

@bdadam
Copy link

bdadam commented Sep 1, 2021

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

@pixelmund
Copy link
Contributor

pixelmund commented Sep 1, 2021

You're right, it seems like the latest version 1.0.0-next.43 doesn't even include these functionality yet, i looked into the source code. Maybe there was no new release since this feature was merged, the last adapter node release is 14 days old but the changes got merged 5 days ago.

@Conduitry
Copy link
Member

#2051 should have had a changeset, but it didn't, so it was never released. cc @benmccann

@benmccann
Copy link
Member

ah, thanks for catching that. released now

@bdadam
Copy link
Author

bdadam commented Sep 1, 2021

Thank you all for the quick reaction and the fix. I can confirm that it works now as described in the readme. Thank you. :)

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

No branches or pull requests

4 participants