Giter VIP home page Giter VIP logo

Comments (3)

Kikobeats avatar Kikobeats commented on May 22, 2024

These global types are provided by TypeScript (from lib.dom.d.ts)

maybe something is wrong in your TS configuration?

from edge-runtime.

jedwards1211 avatar jedwards1211 commented on May 22, 2024

@Kikobeats I understand that's a workaround, but it's not a proper solution... Vercel Edge Runtime will never be a DOM environment. It doesn't have window, it doesn't have document, its fetch accepts nonstandard options, etc.

So lib.dom.d.ts would provide incorrect types for the Vercel Edge Runtime environment.

This is why @cloudflare/workers-types doesn't rely on lib.dom.d.ts; they declare global fetch, File, etc types on their own. @edge-runtime/types will need to do this sooner or later to provide the best developer experience.

This is probably also why the docs page for @edge-runtime/types doesn't say anything about using lib.dom.d.ts.

Can we reopen?

from edge-runtime.

Kikobeats avatar Kikobeats commented on May 22, 2024

It's still unclear to me; This project, even not specifying lib.dom.d.ts as a type, fetch types are being resolved correctly:

CleanShot 2023-08-17 at 11 01 39@2x

The file is

const response = await fetch(url)

from edge-runtime.

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.