sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Browser Cant Display GULP SERVE SharePoint Workbench

Open Debbledon opened this issue 8 years ago • 5 comments

Browser Cant Display GULP SERVE SharePoint Workbench

Category

  • [x] Question
  • [SPACE] Typo
  • [SPACE] Bug
  • [SPACE] Additional article idea

Expected or Desired Behavior

I am trying to create a SharePoint 2016 webpart using Visual Studio CODE (version 1.22.2) and I've been struggling to get it 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 exising aspps 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 would expect that once the app is ready, I should just have to type gulp server in the command prompt to see the web app running in the workbench. 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... I did get past those issues...

In case it matters, I created the site scaffolding with: "yo @microsoft/sharepoint"

Observed Behavior

After running thses commands: "$env:NODE_NO_HTTP2=1" "gulp trust-dev-cert" Build target: DEBUG [11:30:49] Using gulpfile ~\Documents\code\VSCode\amtdHeadl [11:30:49] Starting gulp [11:30:49] Starting 'trust-dev-cert'... [11:30:49] Starting subtask 'trust-cert'... [11:30:49] Finished subtask 'trust-cert' after 132 ms [11:30:49] Finished 'trust-dev-cert' after 134 ms [11:30:50] ==================[ Finished ]================== [11:30:50] Project amtd-headlines-untethered version: 0.0.1 [11:30:50] Build tools version: 2.5.3 [11:30:50] Node version: v9.4.0 [11:30:50] Total duration: 3.38 s "gulp serve"

I cannot get a broswer to actually reach the gulp serve.

It automatically opens IE at this address: https://localhost:5432/workbench

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 message.

I did notice this URL is a different than the address on my working Windwos 10 machine. So I tried changing it and got some errors... (Though I do not know if they are legitimate since I manually changed the URL):

  1. https://localhost:5432/temp/workbench and got this message: Cannot GET /temp/workbench
  2. https://localhost:5432/temp/workbench.html and got this message: Error: ENOENT: no such file or directory, stat 'C:\Users\UName\Documents\code\VSCode\myHelloWorld\dist\public\temp\workbench.html' at Object.fs.statSync (fs.js:968:11) at getPublic (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules@microsoft\sp-client-preview\lib\local\api\getPublic.js:23:19) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\route.js:131:13) at Route.dispatch (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:277:22 at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:349:14) at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:365:14) at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:365:14) at Function.process_params (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:410:3) at next (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:271:10) at ServeTask._setJSONResponseContentTypeMiddleware (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules@microsoft\gulp-core-build-serve\lib\ServeTask.js:138:9) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:312:13) at C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:280:7
  3. https://localhost:5432/workbench.html and got this message: Error: ENOENT: no such file or directory, stat 'C:\Users\UName\Documents\code\VSCode\myHelloWorld\dist\public\workbench.html' at Object.fs.statSync (fs.js:968:11) at getPublic (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules@microsoft\sp-client-preview\lib\local\api\getPublic.js:23:19) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\route.js:131:13) at Route.dispatch (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:277:22 at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:349:14) at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:365:14) at param (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:365:14) at Function.process_params (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:410:3) at next (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:271:10) at ServeTask._setJSONResponseContentTypeMiddleware (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules@microsoft\gulp-core-build-serve\lib\ServeTask.js:138:9) at Layer.handle [as handle_request] (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:312:13) at C:\Users\UName\Documents\code\VSCode\myHelloWorld\node_modules\express\lib\router\index.js:280:7

Anyway, there are no more obvious errors in the browser or at the command line, so I looked at Event Viewer: Running the gulp serve command generates these three errors in teh System log: Log Name: System Source: Schannel Date: 5/4/2018 11:40:47 Event ID: 36871 Task Category: None Level: Error Keywords:
User: SYSTEM Computer: myVMServerName.myDomainName.myCompany.com Description: A fatal error occurred while creating an SSL client credential. The internal error state is 10013. Event Xml: 36871 0 2 0 0 0x8000000000000000 20612 System myVMServerName.myDomainName.myCompany.com client 10013

       Log Name:      System
       Source:        Schannel
       Date:          5/4/2018 11:40:47
       Event ID:      36888
       Task Category: None
       Level:         Error
       Keywords:      
       User:          SYSTEM
       Computer:      myVMServerName.myDomainName.myCompany.com
       Description:
       A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 10. The Windows SChannel error state is 10.
       Event Xml:
       <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
         <System>
           <Provider Name="Schannel" Guid="{1F678132-5938-4686-9FDC-C8FF68F15C85}" />
           <EventID>36888</EventID>
           <Version>0</Version>
           <Level>2</Level>
           <Task>0</Task>
           <Opcode>0</Opcode>
           <Keywords>0x8000000000000000</Keywords>
           <TimeCreated SystemTime="2018-05-04T15:40:47.742020000Z" />
                      <EventRecordID>20614</EventRecordID>
           <Correlation />
           <Execution ProcessID="576" ThreadID="3004" />
           <Channel>System</Channel>
           <Computer>myVMServerName.myDomainName.myCompany.com</Computer>
           <Security UserID="S-1-5-18" />
         </System>
         <EventData>
           <Data Name="AlertDesc">10</Data>
           <Data Name="ErrorState">10</Data>
         </EventData>
       </Event>

At this point, I think it's a certificate error, but I'm not sure why or how to fix it.

Can someone help please?

I have NodeJS v9.4.0 installed and the following npm packages: PS C:\code\VSCode\myHelloWorld> npm list -g --depth=0 C:\Users\UName\AppData\Roaming\npm +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @microsoft/[email protected] +-- @types/[email protected] +-- @types/[email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] `-- [email protected]

PS C:\code\VSCode\myHelloWorld> gulp serve Build target: DEBUG [17:34:15] Using gulpfile C:\code\VSCode\myHelloWorld\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

#spfx-webparts, #gulp

Thanks for your contribution! Sharing is caring.

Debbledon avatar May 04 '18 15:05 Debbledon

You're using Node v9 which isn't officially supported with the SharePoint Framework. Could you see if you can reproduce your issue on Node v8?

waldekmastykarz avatar May 04 '18 19:05 waldekmastykarz

Thanks! I will try that and let you know.

Debbledon avatar May 05 '18 01:05 Debbledon

No response for the checked version, so closing for now.

VesaJuvonen avatar Jun 05 '18 17:06 VesaJuvonen

For me it worked like that:

image

And after I ran

Npm run dev

ltabosa avatar Dec 17 '18 21:12 ltabosa

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 27 '20 18:01 msft-github-bot