You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable debug source info (_debugInfo) in development mode with Next.js using SWC.
Improve compatibility with React DevTools extension for better debugging.
Ensure support for server-side components in development mode.
Non-Goals
This request does not aim to switch from SWC to Babel.
This request does not cover production mode or minification settings.
This request does not include enhancements for other extensions or tools.
Background
I am working on a Next.js project using SWC for compiling. While trying to use the React DevTools extension, I encountered issues with getting debug source info (_debugInfo), particularly with server-side components. The extension works well with other frameworks and build tools (e.g., Webpack + Babel, Vite, CRA..), but similar configurations with Next.js did not produce the desired results.
/** @type {import('next').NextConfig} */constnextConfig={webpack(config,{ dev }){config.mode='development';config.devtool='source-map';// nextjs automatically converts this to eval-source-mapreturnconfig;},reactStrictMode: true,swcMinify: false,productionBrowserSourceMaps: true,};module.exports=nextConfig;
Proposal
I propose adding support for exposing _debugInfo in development mode when using SWC with Next.js, maybe by adding an SWC plugin or a configuration to SWC/nextjs.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
I am working on a Next.js project using SWC for compiling. While trying to use the React DevTools extension, I encountered issues with getting debug source info (_debugInfo), particularly with server-side components. The extension works well with other frameworks and build tools (e.g., Webpack + Babel, Vite, CRA..), but similar configurations with Next.js did not produce the desired results.
This is the .swcrc I've used:
This is the nextjs.config.mjs:
Proposal
I propose adding support for exposing _debugInfo in development mode when using SWC with Next.js, maybe by adding an SWC plugin or a configuration to SWC/nextjs.
Beta Was this translation helpful? Give feedback.
All reactions