-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Unexpected Rendering Engines validation failure (Gatsby v4) #34293
Comments
Debug ScreenRecord
Gatsby internal Load checkpackages/gatsby/src/utils/validate-engines/child.ts export async function validate(directory: string): Promise<void> {
// intercept module loading and validate no unexpected imports are happening
// @ts-ignore TS doesn't like accessing `_load`
mod._load = (request: string, parent: mod, isMain: boolean): any => { packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts externals: [
`cbor-x`, // optional dep of lmdb-store, but we are using `msgpack` (default) encoding, so we don't need it
`babel-runtime/helpers/asyncToGenerator`, // undeclared dep of yurnalist (but used in code path we don't use)
`electron`, // :shrug: `got` seems to have electron specific code path
mod.builtinModules.reduce((acc, builtinModule) => {
if (builtinModule === `fs`) {
acc[builtinModule] = `global _actualFsWrapper`
} else {
acc[builtinModule] = `commonjs ${builtinModule}`
}
return acc
}, {}),
], Analysis`babel-runtime/helpers/asyncToGenerator`, // undeclared dep of yurnalist (but used in code path we don't use) Added above code via PR #33030 , to avoid bundle |
tldr: try removing gatsby-cli and gatsby-recipes from dependencies / devDependencies in your package.json i've also encountered this issue in a similar way on gatsby v4.4.0. in my case, having
the error suggests that the query-engine bundle does not like to see typescript code in a local plugin but i think that's a separate issue. the problem i have is that the project where this error happened is not using any ssg/dsg features so it should have never had needed to come to this step to build or validate engines anyway. from what i can tell, the after a bit of debugging in vscode, i can see the
which is quite strange as we have no direct dependency on gatsby-recipes and it looks like that package has now been deprecated in gatsby v4.5.0 (unreleased at the time of this post). well it turns out that it's a dependency of gatsby-cli (at least in v4.4.0) which is likely why that it's appearing in the action up above.
and if you look at the source code of well i'm not entirely sure how it gets to this point but the file-parser has a small set of criteria of what might constitute a page component and the page.js file in gatsby-recipes satisfies all of it, namely it contains the text while i think this will be fixed in v4.5.0 as the my
i hope this information is helpful 🙏 |
Hey @redabacha - thanks for that deep dive and explanation. Really appreciate it! 4.5.0 will go out on January 11 and we try to keep babel traversal/file parsing as light as possible (as it gets costly) so for now I'd like to keep the AST checking as-is. OP, can you please try the suggestion? |
Thanks for speedy responses! I've tried removing the dependency on
I tried running
Is this a related issue or a separate one? Should I downgrade to the classic yarn? |
I don't think I've seen this error recently, so if you can I'd appreciate it that you try it with yarn 1 or |
I tried yarn v1, and got further, and I'm hitting some gatsby's incompatibilities now:
This seems to be a rabbit hole deeper than I want to go down. My underlying issue is that I'm using a starter that's no longer maintained and I need to migrate to something else, but that's out of scope for this issue. |
I'm just going to drop this of here since i might be useful for someone debugging this. We managed to get this error by simply installing |
Hi, |
Hi, actually I saw that I did not successfully remove the yarn package (I'm used to npm!) the first time. I tried again, and now everything works as expected. And for anyone who might have issues with node-sass, don't upgrade for the moment above 6.0.0. It will throw errors as well. Thanks! |
We've released 4.5 that removed |
It is not fixed. You should re-open this. |
I'm trying to use the Deferred Static Generation (DSG) on some templates, but as soon as I add
Not exactly sure what's going on or if it's somehow related to the original issue. Happy to provide more context! |
@ivanteso Did you find a solution ? I have the same problem. Without any
|
@OoDeLally I am experiencing the same. |
Reference this github issue for the solution: gatsbyjs/gatsby#34293
Reference this github issue for the solution: gatsbyjs/gatsby#34293
Reference this github issue for the solution: gatsbyjs/gatsby#34293
Reference this github issue for the solution: gatsbyjs/gatsby#34293
Reference this github issue for the solution: gatsbyjs/gatsby#34293
Preliminary Checks
Description
After migrating to Gatsby v4,
build
fails with:I don't know Gatsby's internals but it looks like that import is intentional and coming from Gatsby itself: https://github.com/gatsbyjs/gatsby/pull/33030/files#diff-53a98e8932749e1788143dca477bd89b34e3f53d2db77569afac21ddede8f8a4R36
Is that an indication of a bug in Gatsby?
Reproduction Link
https://github.com/gkossakowski/gkossakowski.github.io/tree/gatsby-v4
Steps to Reproduce
gatsby build
Expected Result
Builds successfully.
Actual Result
Error: Generated engines use disallowed import "babel-runtime/helpers/asyncToGenerator". Only allowed imports are to Node.js builtin modules or engines internals.
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: