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

quhf5bfb  于 2023-03-03  发布在  PHP
关注(0)|答案(1)|浏览(156)

我可以在Page方法上添加断点,但不能在generateStaticParams中添加断点。
如果我添加一个console.log,我可以看到它在开发和构建时被调用。
我还尝试将debugger添加到代码中,但效果不佳。
我错过什么了吗?

hec6srdp

hec6srdp1#

通过从Next.js 13.1.1升级到13.2.1解决了问题。
我的包裹

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

然后只需单击"Debug Dev.

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

相关问题