Closed himberjack closed 2 years ago
Hi, can you share any additional info, are you leveraging swcMinify
, do you have any custom config? A repo and exact browser where you are seeing this would help debug also. Before any performance
calls we check that it is defined as can be seen here: https://github.com/vercel/next.js/blob/39318883783668d96b65391b62197fc0767dd26d/packages/next/shared/lib/utils.ts#L385-L389
Hi, I don't have steps unfortunately, it seems to happen sporadically. How can we disable the performance monitor completely?
Currently, it's not possible to turn off performance monitoring.
A likely scenario is that some of your users are on unsupported/older versions of browsers.
Could that be the case?:
https://developer.mozilla.org/en-US/docs/Web/API/Performance#browser_compatibility
UPDATE: From my findings, even Opera supports performance.getEntriesByName
now, so the MDN table might be out of date.
Hi @balazsorban44 It happens on all major browsers:
We also noticed that maybe the fact that the user seems to click on the same page (for unknown reason), it happens:
Could you maybe share at least your code of the /universal
page and your next.config.js
as requested in https://github.com/vercel/next.js/issues/36059#issuecomment-1095320001? I would like to investigate this further.
Sorry, there you go:
const path = require('path');
const withTM = require('next-transpile-modules')(['xxxxxxxxxx/ooooooooo-sdk']);
const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = require('next/constants');
const { init } = require('xxxxxxxxxx/yyyyyyy-utils/secrets-manager');
const { i18n } = require('./next-i18next.config');
const { withSentryConfig } = require('@sentry/nextjs');
const sentryWebpackPluginOptions = {
silent: true
};
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: '/robots.txt',
destination: '/api/robots'
},
{
source: '/ads.txt',
destination: '/api/adstxt'
},
{
source: '/:lang*/sitemap.xml',
destination: '/api/sitemap'
},
{
source: '/sitemap/:lang',
destination: '/api/sitemap'
},
{ source: '/pb_config_(.*)', destination: '/api/pb_config' },
{ source: '/user-config', destination: 'https://old.example.com/user-config' },
{
source: '/src/:path*',
destination: 'https://old.example.com/src/:path*'
},
{
source: '/dist/:path*',
destination: 'https://old.example.com/dist/:path*'
},
{
source: '/api/v1/:path*',
destination: 'https://old.example.com/api/v1/:path*'
},
{ source: '/:category/:slug/:slide', destination: '/:category/:slug?slide=:slide' },
{ source: '/aboutus', destination: '/static/aboutus' },
{ source: '/dmca', destination: '/static/dmca' },
{ source: '/privacy', destination: '/static/privacy' },
{ source: '/tos', destination: '/static/tos' }
];
},
poweredByHeader: false,
reactStrictMode: true,
i18n: {
locales: ['en', 'de', 'es', 'fr', 'it', 'pt', 'ja'],
defaultLocale: 'en'
},
images: {
domains: ['xxxxxxxxx']
},
webpack: (config, options) => {
config.module.rules.push(
// this separate rule is required to make sure that the Prebid.js files are babel-ified. this rule will
// override the regular exclusion from above (for being inside node_modules).
{
test: /.js$/,
include: new RegExp(`\\${path.sep}prebid\\.js`),
use: {
loader: 'babel-loader',
// presets and plugins for Prebid.js must be manually specified separate from your other babel rule.
// this can be accomplished by requiring prebid's .babelrc.js file (requires Babel 7 and Node v8.9.0+)
// as of Prebid 6, babelrc.js only targets modern browsers. One can change the targets and build for
// older browsers if they prefer, but integration tests on ie11 were removed in Prebid.js 6.0
options: require('prebid.js/.babelrc.js')
}
}
);
return config;
}
};
const withBundleAnalyzer =
process.env.NODE_ENV === 'development'
? require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
: null;
const decoratedNextConfig = withSentryConfig(withTM(nextConfig), sentryWebpackPluginOptions);
module.exports = async (phase, { defaultConfig }) => {
if ([PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER].includes(phase)) await init();
if (withBundleAnalyzer) return withBundleAnalyzer(decoratedNextConfig);
else return decoratedNextConfig;
};
Since this is a production env, I can only share the URL: www.discoverytime.com/universal
And it happens on more links, not only /universal obviously
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Provide environment information
next 12.1.4 react 17.0.2 react-dom 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
For some users in production, for various of browsers and OS, we sometimes get the following error.
We saw this code is part of the client: https://github.com/vercel/next.js/blob/39318883783668d96b65391b62197fc0767dd26d/packages/next/client/index.tsx#L586
We are not sure how to disable this performance module completely.
Expected Behavior
Doesn't need to crash
To Reproduce
N/A