Solution: When puppeteer initializes launch, it must add the following parameters [handleSIGINT=False, handleSIGTERM=False, handleSIGHUP=False] to make flask's run-debug mode start and run normally!
Official puppeteer document: https://miyakogi.github.io/pyppeteer/reference.html#launcher
_browser = await launch(
{
"headless": _headless,
"defaultViewport": _defaultViewport,
"args": _args,
"handleSIGINT": False,
"handleSIGTERM": False,
"handleSIGHUP": False
})
The source of ideas for the solution:
1、https://xbuba.com/questions/53679905