Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharepoint requesting files from SPFx solution with wrong port #10031

Open
1 of 9 tasks
sliziky opened this issue Nov 26, 2024 · 2 comments
Open
1 of 9 tasks

Sharepoint requesting files from SPFx solution with wrong port #10031

sliziky opened this issue Nov 26, 2024 · 2 comments
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@sliziky
Copy link

sliziky commented Nov 26, 2024

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 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
  • SPFx version 1.19.0
  • Node.js version 18.20.2
  • etc

Describe the bug / error

I am trying to run a hosted workbench from my SPFx solution on the port 4322 (4321 is reserved by colleague) using URL params ?loadSPFX=true&debugManifestsFile=https://localhost:4322/temp/manifests.js which works fine, I can see the webpart in the webpart list

But when I add the webpart I get this error on the page, and these in the console - looking by URL it seems that Sharepoint is trying to read the files using the port 4321 and not 4322

The solution is run via command gulp serve --nobrowser --max-old-space-size=8192

image
image

serve.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
  "port": 4322,
  "https": true,
  "initialPage": "<my_shp_site>/_layouts/workbench.aspx"
}

Thanks

Steps to reproduce

  1. Set port in serve.json to 4322 and run solution
  2. Add webpart to page
  3. Webpart fails to show and throws error

Expected behavior

I expect Sharepoint to run the solution on port 4322

@sliziky sliziky added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Nov 26, 2024
@sliziky
Copy link
Author

sliziky commented Nov 26, 2024

I found this in the webpart manifest

"loaderConfig": {
  "internalModuleBaseUrls": [
    "https://localhost:4321/dist/",
    "https://localhost:4322/dist/",
  ],
  ...
}

@sliziky
Copy link
Author

sliziky commented Nov 26, 2024

I added "debugBasePath": "https://localhost:4322" and then rebuilt solution using gulp clean and gulp bundle which rebuilt /dist folder correctly - although manifests.json hasnt changed and still contained also localhost:4321, so I went into the file /temp/manifests.js and replaced occurence of 4321 -> 4322 and it works now

@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

2 participants