The stack includes configurations to debug with VSCode.
It is possible to use the step-by-step debugger for:
ℹ️ Learn more about debugging with VSCode
To debug WordPress PHP file using Xdebug:
- Set breakpoints in your WordPress PHP files.
- Start debugging in VSCode by selecting the "Listen for Xdebug on Docker" configuration and clicking the "Start Debugging" button (or press F5).
- Interact with your WordPress site to trigger the breakpoints.
To debug Next.js client-side code:
- Make sure next.js is already running in dev mode
npm run dev - Set breakpoints in your client-side Next.js code.
- Start debugging in VSCode by selecting the "Next.js: debug client-side" configuration and clicking the "Start Debugging" button (or press F5).
- A Chrome window will automatically opens, you can now interact with your Next.js app to trigger the breakpoints.
To debug Next.js server-side code:
- Make sure Next.js is not running
- Set breakpoints in your server-side Next.js code (e.g., in getServerSideProps, or getData functions).
- Start debugging in VSCode by selecting the "Next.js: debug server-side" configuration and clicking the "Start Debugging" button (or press F5).
- Trigger server-side rendering by navigating to pages in your Next.js app.
To debug both server-side and client-side simultaneously:
- Make sure Next.js is not running
- Set breakpoints in both server-side and client-side code.
- Start debugging in VSCode by selecting the "Next.js: debug full stack" configuration and clicking the "Start Debugging" button (or press F5).
- A Chrome window will automatically opens, you can now interact with your Next.js app to trigger the breakpoints on both sides.
To debug Storybook:
- Make sure Storybook is already running
npm run storybook - Set breakpoints in your Storybook stories or components.
- Start debugging in VSCode by selecting the "Storybook: debug" configuration and clicking the "Start Debugging" button (or press F5).
- A Chrome window will automatically opens, you can now interact with your Storybook components to trigger the breakpoints.
🎯 Remember to have the necessary dependencies installed and your development environment properly set up before starting debugging sessions. If you encounter any issues, double-check your environment variables and Docker configurations.