Forum Discussion

john john's avatar
john john
Steel Contributor
Dec 29, 2018

"includeClientSideAssets" is not working when i deploy our client-side web part

I am trying to deploy our client side web part, and this web part uses CSS & JavaScript files. where i am following steps similar to this https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/serve-your-web-part-in-a-sharepoint-page.

 

and inside my web part's package-solution.json file >> i have the includeClientSideAssets = Yes.  but when i upload the .sppkg file to our app catalog, and i add the web part inside a site collection, the web part fail to load, because it was not able to reference the CSS & JavaScript files. here is the error i got:-

 

 

but based on my knowledge , if we have the includeClientSideAssets = Yes, then all the dependencies files (such as CSS & JavaScript) should be included inside the sppkg file... but seems this is not the case??!!

    • john john's avatar
      john john
      Steel Contributor

      NotAlex wrote:

      This will only work if your project is created for SharePoint online and not "Share Point 2016 and later".

       

      In your write-manifest have you modified the cdnBasePath? If so set it back to the below otherwise it will fail

      {
      "cdnBasePath": "<!-- PATH TO CDN -->"
      }
       
      Also include assets should be set to true
      "includeClientSideAssets": true,
       
       
      Hope that helps
       

      thanks for the reply. yes i am working with sharepoint online and not sharepoint 2016...

      • NotAlex's avatar
        NotAlex
        Iron Contributor

        There are 2 options in to Yomen generator so thats why I asked that, one is for SharePoint online only and the other is for both.

         

        Did you check the values in the solution?

Resources