I try to run NextJS development server with SWA emulator. After enabling SSL, emulator crashes after first request. If I do static export of the NextJS site and use that folder with emulator, everything works correctly.
Any ideas what could go wrong? I have tried older versions of SWA Cli + disabled NVM and installed NodeJS directly.
Everything is also described here: https://github.com/Azure/static-web-apps-cli/issues/741
swa-cli.config.json
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"new-swa-test": {
"appLocation": ".",
"outputLocation": ".next",
"appBuildCommand": "npm run build",
"run": "npm run dev",
"appDevserverUrl": "http://localhost:3001",
"ssl": true,
"verbose": "silly"
}
}
}
package.json scripts
"scripts": {
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Output after 'swa start' (certification details snipped away)
[swa] node "C:\Users\heinonenjj\AppData\Roaming\nvm\v18.14.0\node_modules@azure\static-web-apps-cli\dist\msha\server.js" exited with code 0 --> Sending SIGTERM to other processes.. [run] cd "C:\code\swa-test\new-swa-test" && npm run dev exited with code 1 ✖ SWA emulator stoped because the --run command exited with code 1.