Change workbench port
What type of issue is this?
Question
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Target SharePoint environment
SharePoint Online
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- browser version: 112.0.1722.58
- SPFx version: 1.17.1
- Node.js version: v16.19.0
Issue description
I try to change the workbench port to be able to debug multiple solutions at the same time. Ich changed the port in the serve.json to 4322 and the console outputs "Server started https://localhost:4322". But the workbench still tries to reach the default 4321 port "Error GET https://localhost:4321/temp/manifests.js"
I also tried older solutions from the web like configuring in the serve.json "api": { "port": 4322, "entryPath": "[...]" }
When I do a gulp clean and afterwards a gulp serve I can see in the temp folder that manifest.js still has a lot of 4321 port in it. What else do I have to change so the correct new port is used?
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Anyone able to help here? Or is this a bug as the project is using the wrong port also the config has a different setup?
MS will need to confirm, but I suspect the hosted workbench is hard-wired to port: 4321 as part of the workbench system page. You can try setting up a regular SharePoint page, where you can use the query string to change the port for the manifest file. e.g., ?debug=true&noredir=true&debugManifestsFile=https://localhost:4322/temp/manifests.js
I haven't tried this, but it's a simple change. While that may solve your specific question, the larger issue might be trying to debug multiple solutions at the same time. I am not confident that you can put multiple solutions on the same page that are being served through multiple ports. Good luck!
Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.
If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.
We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.