2

Browser Cant Display GULP SERVE SharePoint Workbench

I am trying to create a SharePoint 2016 web-part using Visual Studio CODE (version 1.22.2) and I've been struggling to get the dev environment to work in both Windows 7 and Windows Server 2012 R2 (exact same setup works fine on Windows 10). Right now, I'm focusing on the Windows Server 2012 environment, since I have a little more control there...

To give a bit of background: * Windows 10 Machine: Personal machine I built myself, I am Administrator, all features work as expected. * Windows Server 2012 R2: Work Machine, I have to live with what I have. I am a local administrator but cannot install anything... All of the existing apps were installed by administrators who used pre-packaged deployment tools. There are some (unknown) security restrictions in place (probably group policies) that may be causing problems. * Windows 7: Work Machine, I have to live with what I have. I am now a local administrator but all of the existing apps were installed by someone else using pre-packaged deployment tools... There are some (unknown) security restrictions in place (probably group policies) that may be causing problems.

  • I had to fight just to get the environment to use the "yo @microsoft/sharepoint" command...
  • Then I had to fight just to get gulp to run (it was saying sp-build-web was not installed even though it was...)

Now I cannot get a browser to actually reach the gulp serve. -Yes, I tried the "$env:NODE_NO_HTTP2=1" command. -Yes I also used the "gulp trust-dev-cert" command

Internet Explorer 11 only shows: This page can't be displayed * Make sure the web address https://localhost:5432 is correct. * Look for the page with your search engine. * Refresh the page in a few minutes.

Chrome displays a similar error.

I've run out of ideas. I don't see any errors below I can continue to follow up on...

Can someone help please?

I have NodeJS v9.4.0 installed and the following npm packages: PS C:\code\VSCode\amtdHeadlines_untethered> npm list -g --depth=0 C:\Users\UName\AppData\Roaming\npm +-- @microsoft/generator-sharepoint@1.4.1 +-- @microsoft/sp-build-web@1.4.1 +-- @microsoft/sp-client-base@1.0.0 +-- @microsoft/sp-client-preview@1.4.1 +-- @microsoft/sp-core-library@1.4.1 +-- @microsoft/sp-module-interfaces@1.4.1 +-- @microsoft/sp-page-context@1.4.1 +-- @microsoft/sp-webpart-base@1.4.1 +-- @microsoft/sp-webpart-workbench@1.4.1 +-- @types/chai@4.1.3 +-- @types/mocha@5.2.0 +-- ajv@6.4.0 +-- ansi-regex@2.1.1 +-- balanced-match@1.0.0 +-- brace-expansion@1.1.11 +-- code-point-at@1.1.0 +-- compass@0.1.1 +-- concat-map@0.0.1 +-- console-control-strings@1.1.0 +-- express@4.16.3 +-- generator-aspnet@0.3.3 +-- generator-code@1.1.30 +-- generator-hottowel@0.6.1 +-- generator-webapp@3.0.1 +-- graceful-fs@4.1.11 +-- grunt@1.0.2 +-- gulp@4.0.0 +-- inherits@2.0.3 +-- is-fullwidth-code-point@1.0.0 +-- minimatch@3.0.4 +-- minimist@0.0.8 +-- minipass@2.2.4 +-- mkdirp@0.5.1 +-- mocha@5.1.1 +-- ncu@0.2.1 +-- npm@6.0.0 +-- npm-check-updates@2.14.2 +-- number-is-nan@1.0.1 +-- office-ui-fabric-js@1.5.0 +-- office-ui-fabric-react@5.94.0 +-- once@1.4.0 +-- react@16.3.2 +-- react-addons-update@15.6.2 +-- react-dom@16.3.2 +-- request@2.85.0 +-- safe-buffer@5.1.2 +-- string-width@1.0.2 +-- strip-ansi@3.0.1 +-- wrappy@1.0.2 +-- yallist@3.0.2 +-- yarn@1.6.0 `-- yo@2.0.2

PS C:\code\VSCode\amtdHeadlines_untethered> gulp serve
Build target: DEBUG
[17:34:15] Using gulpfile C:\code\VSCode\amtdHeadlines_untethered\gulpfile.js
[17:34:15] Starting gulp
[17:34:15] Starting 'serve'...
[17:34:15] Starting subtask 'pre-copy'...
[17:34:15] Finished subtask 'pre-copy' after 8.26 ms
[17:34:15] Starting subtask 'copy-static-assets'...
[17:34:15] Starting subtask 'sass'...
[17:34:16] Finished subtask 'sass' after 904 ms
[17:34:16] Starting subtask 'tslint'...
[17:34:16] Starting subtask 'typescript'...
[17:34:16] [typescript] TypeScript version: 2.2.2
[17:34:16] Finished subtask 'copy-static-assets' after 939 ms
[17:34:18] Finished subtask 'tslint' after 1.45 s
[17:34:18] Finished subtask 'typescript' after 1.45 s
[17:34:18] Starting subtask 'ts-npm-lint'...
[17:34:18] Finished subtask 'ts-npm-lint' after 8.62 ms
[17:34:18] Starting subtask 'api-extractor'...
[17:34:18] Finished subtask 'api-extractor' after 1.33 ms
[17:34:18] Starting subtask 'post-copy'...
[17:34:18] Finished subtask 'post-copy' after 700 μs
[17:34:18] Starting subtask 'collectLocalizedResources'...
[17:34:18] Finished subtask 'collectLocalizedResources' after 5.07 ms
[17:34:18] Starting subtask 'configure-webpack'...
[17:34:18] Finished subtask 'configure-webpack' after 504 ms
[17:34:18] Starting subtask 'webpack'...
(node:6804) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https
://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[17:34:19] Finished subtask 'webpack' after 676 ms
[17:34:19] Starting subtask 'configure-webpack-external-bundling'...
[17:34:19] Finished subtask 'configure-webpack-external-bundling' after 1.14 ms
[17:34:19] Starting subtask 'copy-assets'...
[17:34:19] Finished subtask 'copy-assets' after 63 ms
[17:34:19] Starting subtask 'write-manifests'...
[17:34:19] Finished subtask 'write-manifests' after 407 ms
[17:34:19] Starting subtask 'serve'...

Starting api server on port 5432. Registring api: /getwebparts Registring api: /. Registring api: /workbench [17:34:20] Finished subtask 'serve' after 483 ms [17:34:20] Finished 'serve' after 4.61 s (node:6804) ExperimentalWarning: The http2 module is an experimental API. [17:34:20] Server started https://localhost:4321 [17:34:20] LiveReload started on port 35729 [17:34:20] Opening https://localhost:5432/workbench using the default OS app Request: [::1] '/workbench' [17:34:20] ==================[ Finished ]================== [17:34:21] Project amtd-headlines-untethered version: 0.0.1 [17:34:21] Build tools version: 2.5.3 [17:34:21] Node version: v9.4.0 [17:34:21] Total duration: 7.79 s

ASpulak
  • 21
  • 3

1 Answers1

3

Free the port 5432 since it is probably being used by another process.

Alternatively serve the application using a different config. Go to 'config.serve.js' and change the port to your preferred port e.g. from '5432' to '8080' as follows:

{
 "$schema": "https://developer.microsoft.com/json-schemas/core- 
build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:8080/workbench",
"api": {
   "port": 8080,
   "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
  }
}
georgeouma
  • 123
  • 2
  • 10