Giter VIP home page Giter VIP logo

Comments (8)

michaelgmcd avatar michaelgmcd commented on May 19, 2024

After looking at this a bit more, even a simple:

export const loader = () => {
  return json({})
}

throws the same error:

TypeError: headers.getSetCookie is not a function or its return value is not iterable
    at proxyResponseToResponseStub (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/server-runtime/dist/single-fetch.js:292:25)
    at eval (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/server-runtime/dist/single-fetch.js:61:9)
    at async Promise.all (index 1)
    at async eval (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/server-runtime/dist/single-fetch.js:39:19)
    at async callDataStrategyImpl (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/router/dist/router.cjs.js:4169:17)
    at async callDataStrategy (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/router/dist/router.cjs.js:3702:19)
    at async loadRouteData (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/router/dist/router.cjs.js:3677:19)
    at async queryImpl (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/router/dist/router.cjs.js:3522:20)
    at async Object.query (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/router/dist/router.cjs.js:3416:18)
    at async handleDocumentRequest (file:///home/projects/remix-run-remix-tfwhw2/node_modules/@remix-run/server-runtime/dist/server.js:222:15)

from remix.

michaelgmcd avatar michaelgmcd commented on May 19, 2024

Found the culprit for the first issue. installGlobals without nativeFetch uses remix's own polyfill, which doesn't implement headers.getSetCookie. The docs aren't clear on whether or not installGlobals should be called for custom servers.

from remix.

coji avatar coji commented on May 19, 2024

I am having the same problem with vercel.

Here is my reproduction code.
https://github.com/coji/remix-vercel-single-fetch-test

I was wondering where to put installGlobals since it's not a custom server.

from remix.

Tsirimaholy avatar Tsirimaholy commented on May 19, 2024

I commented on the Vercel Fork, but I will leave it there in case it may help.
I'm getting this error too. I tried to use node 20 if it solves the issue, but it's the same.
The server is not accessible (Just blank screen).
Mine is just a local dev environment.
I tried to dig deeper a little bit and there I see this line:

for (let v of headers.getSetCookie()) {

Even the comments themselves acknowledge the presence of certain typing issues.
I want to contribute to solve this issue, but i'm not a yet great JS dev myself 😅 .

from remix.

brophdawg11 avatar brophdawg11 commented on May 19, 2024

Regarding the headers issue - It looks like we may have missed this call out in the docs and only included it in the release notes: https://github.com/remix-run/remix/blob/main/CHANGELOG.md#single-fetch-unstable

Single fetch requires using the built-in fetch on node 20, or passing the new option to installGlobals({ nativeFetch: true }) in your custom server.

I’ll get that added to the docs 👍

Update Added to the docs in #9335

from remix.

michaelgmcd avatar michaelgmcd commented on May 19, 2024

Just came back here to say the same thing. Rereading the release notes and saw it.

from remix.

brophdawg11 avatar brophdawg11 commented on May 19, 2024

To recap here, I think this can be closed out?

  1. was due to a missing installGlobals({ nativeFetch: true }) - we added a call out to the docs inhttps://github.com//pull/9335.
  2. is a duplicate of #9314 and being addressed in #9349. We are adding the response stub to resource routes to eliminate the ambiguity, and I think we are also probably going to look into a LoaderFunctionArgs override in the future/single-fetch.d.ts file so we don't have to introduce response as optionl when apps have not opted into single fetch.

Please let me know if anything is still outstanding and we can re-open!

from remix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.