Code Monkey home page Code Monkey logo

Comments (3)

darylwright avatar darylwright commented on July 18, 2024 1

I've confirmed that I no longer experience this issue with v3.1.1. This issue can be closed.

from gatsby-typescript.

darylwright avatar darylwright commented on July 18, 2024

Running cross-env GATSBY_GRAPHQL_IDE=playground NODE_OPTIONS="--trace-warnings" gatsby develop --verbose produces the following output:

 ERROR 

(node:3480) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
    at emitExperimentalWarning (node:internal/util:224:11)
    at node:stream/web:7:1
    at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
    at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
    at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
    at Function.Module._load (node:internal/modules/cjs/loader:804:15)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (<PATH REDACTED>\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object.<anonymous> (<PATH REDACTED>\node_modules\cross-undici-fetch\dist\node-ponyfill.js:31:24)
    at Module._compile (<PATH REDACTED>\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (<PATH REDACTED>\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at Object.<anonymous> (<PATH REDACTED>\node_modules\@graphql-tools\url-loader\index.js:37:26)

This appears to be a problem with the @graphql-tools/url-loader library based on the trace information. The line in question within this library is an import:

const crossUndiciFetch = require('cross-undici-fetch');

cross-undici-fetch requires stream/web in https://github.com/ardatan/w3-server/blob/master/packages/cross-undici-fetch/dist/node-ponyfill.js on line 31. This library was introduced in this commit of @graphql-tools/url-loader.

gatsby-plugin-graphql-codegen currently has v7.0.0 (i.e. ^7.0.0 with the current version at v7.7.1) of the @graphql-tools/url-loader as a dependency and is used in packages/gatsby-plugin-graphql-codegen/src/gatsby-node.ts. Latest commit for this is 8219851 on Oct 28, 2021. Before that on commit e68b6d5, @graphql-tools/url-loader was at v6.10.1.

It seems the folks in the @graphql-tools team thought it was a good idea to use an experimental feature for a production release. Until these upstream issues are resolved, the current solution should be for devs to rollback their gatsby-plugin-graphql-codegen dependencies to v3.0.0 or the latest v2 if possible. I can confirm that rolling back to v3.0.0 (exact version only) resolves this error, albeit with the following warning:

warn Plugin gatsby-plugin-graphql-codegen is not compatible with your gatsby version 4.6.0 - It requires gatsby@^3.0.0

As far as this project goes, the @graphql-tools/url-loader version should be rolled back to the last one that does not use cross-undici-fetch, namely v7.4.2.

Edit: I forgot to mention that this issue prevents gatsby-plugin-graphql-codegen from working for me unless I rollback to v3.0.0.

Edit2: Confirmed that stream/web is still experimental as of the most recent version of Node (v17.4.0) as indicated here.


Environment:

  • Windows 10
  • Gatsby v4.6.0
  • TypeScript v4.5.5
  • Node v16.13.0
  • gatsby-plugin-graphql-codegen v3.1.0

from gatsby-typescript.

igneosaur avatar igneosaur commented on July 18, 2024

I just moved to gatsby-plugin-typegen.

from gatsby-typescript.

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.