Comments (3)
I've confirmed that I no longer experience this issue with v3.1.1
. This issue can be closed.
from gatsby-typescript.
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.
I just moved to gatsby-plugin-typegen
.
from gatsby-typescript.
Related Issues (20)
- Outdated and Deprecated Dependencies HOT 4
- No graphql type is generated (maybe related to gatsby-plugin-ts-config) HOT 8
- Source maps don't show up HOT 3
- [gatsby-plugin-graphql-codegen] Ignore or exclude certain match? HOT 1
- [gatsby-plugin-graphql-codegen] npm audit security report HOT 2
- Release v2.7.2 on npm HOT 1
- Minified React error #31 HOT 1
- Generating Types for Image queries fluid/fixed ambiguous?
- npm warn GraphQL Toolkit is deprecated and merged into GraphQL Tools HOT 1
- [gatsby-plugin-graphql-codegen] gatsby 3.0.0 compatibility HOT 12
- codegen is extremely slow after upgrading from gatsby 2.24.11 to 2.24.12 HOT 1
- [gatsby-plugin-graphql-codegen] - Failed to validate error Error [ValidationError]: "name" is not allowed HOT 4
- [gatsby-plugin-graphql-codegen] Error: Invalid Custom Plugin "codegen-plugin-0" HOT 1
- Why is every part of the GraphQL query optional ? HOT 2
- [gatsby-plugin-graphql-codegen] Error when using gatsby-source-wordpress on Gatsby 4 HOT 1
- Unable to find GraphQL type definitions HOT 1
- Minified react error: Objects are not valid as a React child error HOT 1
- Separating queries and type defs with codegen HOT 1
- Is there a way to generate graphql-type outside gatsby? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-typescript.