Trying to create a SPFx webpart for SP2016 and debug it on a workbench.
"gulp serve" tryes to start the workbench, but fails.
You can see:
PS H:\Repos\SPFx\sp-fx> gulp serve
Build target: DEBUG
[21:50:11] Using gulpfile H:\Repos\SPFx\sp-fx\gulpfile.js
[21:50:11] Starting gulp
[21:50:11] Starting 'serve'...
[21:50:11] Starting subtask 'pre-copy'...
[21:50:11] Finished subtask 'pre-copy' after 3.75 ms
[21:50:11] Starting subtask 'copy-static-assets'...
[21:50:11] Starting subtask 'sass'...
[21:50:12] Finished subtask 'sass' after 465 ms
[21:50:12] Starting subtask 'tslint'...
[21:50:12] Starting subtask 'typescript'...
[21:50:12] [typescript] TypeScript version: 2.2.2
[21:50:12] Finished subtask 'copy-static-assets' after 485 ms
[21:50:12] Finished subtask 'tslint' after 713 ms
[21:50:12] Finished subtask 'typescript' after 723 ms
[21:50:12] Starting subtask 'ts-npm-lint'...
[21:50:12] Finished subtask 'ts-npm-lint' after 7.18 ms
[21:50:12] Starting subtask 'api-extractor'...
[21:50:12] Finished subtask 'api-extractor' after 490 渭s
[21:50:12] Starting subtask 'post-copy'...
[21:50:12] Finished subtask 'post-copy' after 254 渭s
[21:50:12] Starting subtask 'collectLocalizedResources'...
[21:50:12] Finished subtask 'collectLocalizedResources' after 2.01 ms
[21:50:12] Starting subtask 'configure-webpack'...
[21:50:12] Finished subtask 'configure-webpack' after 233 ms
[21:50:12] Starting subtask 'webpack'...
(node:13056) 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.
[21:50:13] Finished subtask 'webpack' after 411 ms
[21:50:13] Starting subtask 'configure-webpack-external-bundling'...
[21:50:13] Finished subtask 'configure-webpack-external-bundling' after 722 渭s
[21:50:13] Starting subtask 'copy-assets'...
[21:50:13] Finished subtask 'copy-assets' after 84 ms
[21:50:13] Starting subtask 'write-manifests'...
[21:50:13] Finished subtask 'write-manifests' after 216 ms
[21:50:13] Starting subtask 'serve'...
Starting api server on port 5432.
Registring api: /getwebparts
Registring api: /.
Registring api: /workbench
[21:50:13] Finished subtask 'serve' after 261 ms
[21:50:13] Finished 'serve' after 2.44 s
(node:13056) ExperimentalWarning: The http2 module is an experimental API.
[21:50:13] Server started https://localhost:4321
[21:50:13] LiveReload started on port 35729
[21:50:13] Opening https://localhost:5432/workbench using the default OS app
Request: [::1] '/workbench'
[21:50:14] ==================[ Finished ]==================
[21:50:14] Project sp-fx version: 0.0.1
[21:50:14] Build tools version: 2.5.3
[21:50:14] Node version: v8.9.4
[21:50:14] Total duration: 4.49 s
That's it. Chrome shows "ERR_SSL_PROTOCOL_ERROR". If I disable https in the serve.json ist shows I can use the local workbench. (finally) BUT: not the O365-Workbench
Run the YO generator and for "Which baseline packages do you want to target for your component(s)?" pick "SharePoint 2016 onwards, including SharePoint Online" and use React.
Did I miss some documentation about the 2016-Projects?
I was running into this and deleted node_modules, did a full reinstall, retrusted dev cert and it seems to have cleared up the issue I was having.
I tried that. It did unfortunately not resolve it for me.
SPFx v1.1.0 which is used for SharePoint 2016 doesn't support Node.js v8. Downgrade to Node.js v6 LTS and it will work.
Node 8 is only supported for SPFx v1.4.1
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
Most helpful comment
SPFx v1.1.0 which is used for SharePoint 2016 doesn't support Node.js v8. Downgrade to Node.js v6 LTS and it will work.