-
Notifications
You must be signed in to change notification settings - Fork 135
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
[🐛 Bug]: Incompatible with Next.js instrumentation #678
Comments
If I run next-on-pages with |
It's safe to, you'll just have a much much larger bundle size |
Any update on this? @Maronato were you able to find a workaround other than disabling the ChunksDedup? |
Just leaving some insights, in case anyone is interested: As @ostenbom indicated, the above error seems to originate from the Webpack module ID assignment. Overwriting the default assignment algorithm fixes the error; however, it results in a much larger bundle size (a factor of 8 in my case), which usually makes the bundle exceed Cloudflare's maximum limit of 25 MB. Example that fixes the error, but bloats the bundle size: //next.config.js
webpack: (config) => {
config.optimization = {
...config.optimization,
moduleIds: false, // Disable built-in module ID algorithms
};
config.plugins.push(new webpack.ids.NaturalModuleIdsPlugin());
} I tried all algorithms listed in the webpack optimization documentation, but all of them either cause the build error or led to a significant increase in bundle size. Trying other options to reduce the bundle size did not make a significant difference. This is unfortunate, as this is by far the most convenient way of adding observability to a Next.js application. From Cloudflare's perspective, fixing this would especially make sense given their acquisition of Baselime, which is currently almost useless for Cloudflare Pages (except for Edge logging). I hope this issue will be addressed at some point. |
Hi! Did anyone find a solution for this? We are trying to use the Next.js install method for Sentry, and get the following error when running
|
I just ran into this issue for https://github.com/aibtcdev/aibtcdev-frontend (feat/cloudflare branch), was looking to transfer services over to Cloudflare Pages but ran into the same error after following the config instructions. We are also using Sentry and the Testing out the workaround now. Edit: looks like that worked! For now just using |
Setting @sentry/nextjs to version |
Thanks. |
I get this issue just using @vercel/otel, not even sentry. (Similiar to the original poster) - Is there going to be a fix for this soon? 16MB bundle size isn't fun... |
It's been months yet there are no updates to this issue |
next-on-pages environment related information
Description
next-on-pages breaks when using Next's default instrumentation
@vercel/otel
, resulting in the following error:Reproduction
Repo: https://github.com/Maronato/next-on-pages-instrumentation-repro
Steps to reproduce:
npm create cloudflare@latest next-on-pages -- --framework=next
@vercel/otel
(npm install @vercel/otel
)experimental: { instrumentationHook: true }
to your next configsrc
or root of the project calledinstrumentation.ts
npx next-on-pages
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
The error seems to happen in this function, but I'm not sure why.
A few notes:
registerOTel
is not required. Simply printing it (console.log(registerOTel)
) is enough to cause the errorWould you like to help?
The text was updated successfully, but these errors were encountered: