如何在 PhpStorm 中调试 generateStaticParams (Next.js)?

问题描述 投票:0回答:1

我可以在我的页面方法上添加断点,但不能在里面

generateStaticParams
.

如果我添加一个 console.log,我可以看到它在开发和构建时被调用。

我也尝试将

debugger
添加到代码中,但效果不佳。

我在这里遗漏了什么吗?

debugging next.js phpstorm next.js13
1个回答
0
投票

从 Next.js 13.1.1 升级到 13.2.1 解决了问题

我的包.json:

//...
"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
//...

然后只需要点击Debug Dev。

提示:如果它不起作用,请关闭浏览器会话,然后在 phpstorm 运行控制台中单击 https://localhost:3000 链接。

© www.soinside.com 2019 - 2024. All rights reserved.