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
Broken on Next.js 10.2.0 which uses Webpack 5 when running a custom server to support HTTPS locally #6925
Comments
Related to #6564, we need to upgrade to |
It would be great to have an update on this. I'm stuck on Next.js v10.1.3 and Prisma v2.23.0 until this is resolved. Thanks! |
This is in the making (currently works) #8842. If you want, you can give it a try by installing this version instead |
@millsp thanks, I gave it a try.
|
@gavrichards node v16.5.0 is required according to https://nodejs.org/api/webstreams.html#webstreams_new_readablestream_underlyingsource_strategy |
Thanks for the feedback, and sorry about this. |
@gavrichards can you please provide a repro? Which node version are you using? I could not reproduce this on node |
I'm on Is this not the case in your original message?
|
It does get all bundled, but I could not reproduce this locally, so my first assumption that it gets all loaded at once might not hold as I could not reproduce this locally. This also never shows in our tests. That only seems to be used on their |
Weird because as you can see in my earlier comment, the use of stream/web comes from prisma/client/runtime/index.js |
@gavrichards If it helps I upgraded to nextjs 11.1.0 / webpack 5, prisma 2.30.0 and this next.config.js trick still works with node 14.x: webpack: (config, { defaultLoaders, isServer }) => {
// thx https://github.com/prisma/prisma/issues/6899#issuecomment-849126557
if (isServer) {
config.externals.push('_http_common');
}
return config;
}, PS: a full config is here https://github.com/belgattitude/nextjs-monorepo-example/blob/main/apps/web-app/next.config.js#L127 |
@gavrichards Yes, all gets bundled because |
Ok I updated to Prisma |
@gavrichards yes seems working fine without 😄 Test here: belgattitude/nextjs-monorepo-example#327 |
For what it's worth, I simply needed to remove |
You are a life saver. Exact same issue here and removing the serverless target did the trick. Thanks for sharing! |
Hey everyone, this has been fixed in |
@millsp is this fixed in the 3.11.1 version or do we need to wait? |
As Pierre wrote, this is fixed in |
I've ended up here as I'm seeing a similar issue but only after upgrading to 3.12.0 from 3.11.1:
I'm not sure if this is a different issue, I wanted to flag it just in case. Happy to open up a ticket for it if needed. I'm currently investigating a separate problem so I'm not in a rush to resolve this one. Once I have more time I'm happy to do some investigation. |
That is a follow up issue to use finally merging Undici 4 I would guess, so a new issue with full information would be most welcome. THanks @MGough. |
Hey @MGough, are you generating in a custom location? |
We are using Prisma 4.4.0 (latest at time of writing) and are seeing the issue reported here when including the Prisma runtime as part of a webpack bundle:
To get around it we added
The above was all that was required for us to successfully bundle Prisma 4.4.0 with webpack. Whether it runs OK is another thing... I will try and update this message once we validate that. 🙏 |
This error feels weird to me, webpack should treat this as a native module. I assume that you're bundling on Node 14 then? |
We are using Node v16.16.0 |
Thanks. I am not sure why webpack wouldn't treat this as a native module. I have found a similar issue in the dependency responsible for this. However, it was closed as "Not Planned". If you have the time, could you work on a reproduction? I could then push forward for fixing this. |
Bug description
When I upgrade Next.js to 10.2.0 which uses Webpack 5 and then run
node server.js
to run my app locally using HTTPS, I get this error:How to reproduce
Typically you run Next.js apps locally by running
npm run dev
and that's it, but if you want to use HTTPS locally then you have to do something a bit different which involves creating a file usually called "server.js" which attaches the SSL certificate and then runs the server. I have no idea if this particularly issue is related to that or if it would happen without HTTPS, as I only use this method now. I'm hoping the error message alone might make the issue apparent to anyone who understands what it's saying, and why Webpack 5 would cause this.Expected behavior
Everything works just as it would on Next.js <10.2.0 / Webpack 4.
Environment & setup
The text was updated successfully, but these errors were encountered: