React Profiler for Next 15 and React 19 on production build

Please help guys, I have been banging my head on the keyboard over this.

Profiling does not work at all on a production build despite doing this.

if (!isServer && isVercelPreview) {
			console.log('🔧 profiling enabled');
			config.resolve.alias['react-dom/client'] = 'react-dom/profiling'; // I have also tried react-dom$
			config.resolve.alias['scheduler/tracing'] = 'scheduler/tracing-profiling';
		}

Next 15 15.3.5, React 19.0.0

I often get complaints about mismatched react and react-dom version when trying to do this.

2 Likes

Same, would love some official documentation on this.

1 Like