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

TypeError: cookies is not iterable #9091

Closed
Vextil opened this issue Feb 17, 2023 · 2 comments
Closed

TypeError: cookies is not iterable #9091

Vextil opened this issue Feb 17, 2023 · 2 comments
Labels
blocked by upstream bug Something isn't working
Milestone

Comments

@Vextil
Copy link
Contributor

Vextil commented Feb 17, 2023

Describe the bug

After updating kit from 1.5.5 to 1.7.1 I'm getting the following error on every request:

TypeError: cookies is not iterable
    at Headers.get [headers map sorted] (/project/app/node_modules/undici/lib/fetch/headers.js:430:29)
    at /project/app/node_modules/undici/lib/fetch/headers.js:476:21
    at Headers Iterator.next (/project/app/node_modules/undici/lib/fetch/util.js:731:22)
    at Module.serialize_data (/node_modules/@sveltejs/kit/src/runtime/server/page/serialize_data.js:55:24)
    at eval (/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:367:27)
    at Array.map (<anonymous>)
    at Module.render_response (/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:366:5)
    at async Module.render_page (/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:306:10)
    at async resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:371:17)
    at async Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:242:20)

Reproduction

Happens when making a server-side fetch to an endpoint that returns a Set-Cookie header.

Seems to be an issue with the new undici version:
nodejs/undici#1935

Fixed here, but no release yet:
nodejs/undici#1936

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 AMD Ryzen 5 5600G with Radeon Graphics
    Memory: 2.42 GB / 5.95 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    npm: 8.15.0 - /usr/local/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0 => 1.0.3 
    @sveltejs/adapter-cloudflare: ^2.0.1 => 2.0.2 
    @sveltejs/adapter-node: ^1.1.8 => 1.2.0 
    @sveltejs/kit: ^1.7.1 => 1.7.1 
    svelte: ^3.55.0 => 3.55.1 
    vite: ^4.1.0 => 4.1.2

Severity

blocking an upgrade

Additional Information

Probably nothing we can do other than waiting for a new undici version. Rollback not recommended because of security vulnerabilities.
Publishing the issue anyway so if anyone else runs into the same issue they can find this.

@smblee

This comment was marked as duplicate.

@Vextil
Copy link
Contributor Author

Vextil commented Feb 21, 2023

Fixed on #9106
Latest 1.8.3 version of SvelteKit is working fine.

@Vextil Vextil closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by upstream bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants