using Portal for ArcGIS 10.4, either upgrade to Portal for ArcGIS 10.5 or use the Web AppBuilder for ArcGIS Developer edition with Portal for ArcGIS. Refer to: <a href="https://developers.arcgis.com/web-appbuilder/" target="_blank">https://developers.arcgis.com/web-appbuilder/</a>.