-
Notifications
You must be signed in to change notification settings - Fork 44
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
Node v14 support #34
Comments
`../../node_modules/.pnpm/fast-json-stringify@1.21.0/node_modules/fast-json-stringify/index.js Import trace for requested module: ../../node_modules/.pnpm/fast-json-stringify@1.21.0/node_modules/fast-json-stringify/index.js Import trace for requested module: ../../node_modules/.pnpm/fast-json-stringify@1.21.0/node_modules/fast-json-stringify/index.js Import trace for requested module: ./.graphclient/index.ts Import trace for requested module: ../../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js Import trace for requested module: ../../node_modules/.pnpm/ws@7.5.7/node_modules/ws/lib/buffer-util.js Import trace for requested module: ../../node_modules/.pnpm/ws@7.5.7/node_modules/ws/lib/validation.js Import trace for requested module: ../../node_modules/.pnpm/ws@8.5.0/node_modules/ws/lib/buffer-util.js Import trace for requested module: ../../node_modules/.pnpm/ws@8.5.0/node_modules/ws/lib/validation.js Import trace for requested module: ../../node_modules/.pnpm/@graphql-mesh+utils@0.27.9/node_modules/@graphql-mesh/utils/index.mjs Import trace for requested module: ../../node_modules/.pnpm/@graphql-mesh+utils@0.33.0/node_modules/@graphql-mesh/utils/index.mjs Import trace for requested module: ../../node_modules/.pnpm/@graphql-tools+url-loader@7.9.7_@types+node@17.0.21/node_modules/@graphql-tools/url-loader/index.mjs Import trace for requested module:
SyntaxError: Unexpected token '??=' |
Actually GraphQL Tools and GraphQL Mesh have been tested on Node 12(which is lower than Node 14) and 17; I think the issue looks like something else specific for Vercel cc @dotansimha |
@matthewlilley This seems to be a webpack issue. Can you verify the same happens without bundling your AWS Lambda code? (fastify/fast-json-stringify#67) |
@n1ru4l I was able to run in Next.js development mode using both Node v14 & v16, still plenty of those errors such as "Critical dependency: the request of a dependency is an expression" and "Module not found: Can't resolve 'utf-8-validate'" but it still works fine in development mode The breaking error is the "Unexpected token '??='" during a regular build |
Also, production build on Node v16 is successful and works fine. Node v14 is breaking with "Unexpected token '??='" |
@matthewlilley Can you give more context (e.g. a non-webpack butchered stack trace) on where that syntax error is happening? It seems like a dependency is using the Logical Assignment |
@n1ru4l I've struggled to find the exact dependency which is the trouble maker, but whenever the codegenerated SDK is used during build time it will bail with this error. I was able to avoid the error during build by using a dynamic import, but the error is still thrown at runtime during a function invocation. This is the branch I'm working from: https://github.com/sushiswap/interface/tree/feature/analytics |
@matthewlilley Can you please search your node_modules for usages of the |
@n1ru4l I've been speaking with the Vercel team about this issue and they've said that "Since deps are not compiled when being used server-side, this error can't be avoided unless the child deps of graphql-mesh support v14 (even in GSSP)" I searched node modules and could find no usages of ??= operator, only in the .next output folder. 🤔 |
Does the occurence within the |
I narrowed it down using the GitHub search: https://github.com/search?p=3&q=schemeFetch&type=Code |
@n1ru4l "It's a child dep of @graphql-mesh/types" |
I created nodejs/undici#1318 |
@n1ru4l Legend. Thanks for sticking with me on this one 👊 |
Merged in |
I don't think this issue happens on a regular NodeJS v14 project because undici isn't called on Node 14. So there is bundler or sth here and if there is bundler, it should be fairly easy to transpile the code to a specific Node version. |
Hi there! With the recent upgrades in |
@dotansimha looks like this needs to be re-opened. |
This happens because Webpack tries to bundle all code, and not just the runtime code that's used (which makes sense...). I'm reopening, let's wait for nodejs/undici#1372 to be resolved and have a new release of |
@dotansimha Yeah, makes sense. v5.1.0 was released a few hours ago. |
Perfect! I see @ardatan already released So now the missing piece in that puzzle is: release GraphQL-Mesh -> then we can upgrade and release In the meantime, if you are using Yarn, you can add to your "resolutions": {
"undici": "5.1.0"
} |
Yeah, sometimes NPM needs a few minutes after publishing a new version :) |
aha, too fast |
We have a new one unfortunately :( This is different from the previous... |
Can you please try |
I'll dump output here, couldn't see anything from a quick glance.
|
I see |
one second, there's multiple apps in here |
I'll update all to 0.0.7 and try again, but I expect it's just because another app which I'm not trying to build is using it. |
@ardatan all are using 0.0.7 now and same issue. This error is different from the previous though. Could it be another depedency? |
This is a new error related to ??= operator, unrelated I think to previous. |
Looks like there's another culprit in the same library... |
Do you have an example repository in somewhere so we can try to patch it and make sure that's the issue? |
@ardatan Yes, I can give you install commands.
|
Of course, make sure you're on lts/fermium :) |
@ardatan are you able to weigh in here? nodejs/undici#1397 |
@matthewlilley btw, what's your complete project setup? (next? something else? what bundler are you use and what's the version?) Actually the issue here is not even about runtime - since Mesh will not even use |
@matthewlilley as @dotansimha mentioned this is an issue with bundling in NextJS and transpiling
const withTM = require('next-transpile-modules')(['undici'])
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// your config option
}
module.exports = withTM(nextConfig) Checkout saihaj/ens-nft-graph-client@e58d714 |
@dotansimha Vercel gave us experimental access to Node 16 which has rid the block for us for now. @saihaj Ah, silly I didn't try this. We use next-transpile-modules a lot, but mostly for local packakges which don't have a build step. |
Thanks for the update @matthewlilley ! |
@dotansimha should be continue to keep this one open? Node 16 support has pretty good coverage on our end now. |
It seems that we're locked into depedencies which will only work on Node v16. Unfortuantely even AWS isn't supporting v16 yet which means we're blocked from using this. I have done some trial and error to find v14 compatbile options, but unable to find any compatible combination so far.
The text was updated successfully, but these errors were encountered: