Forum Discussion

JaydenMarquardt's avatar
JaydenMarquardt
Copper Contributor
Jun 28, 2021
Solved

Issue Deploying to tenant app catalog

Hey I have been trying to deploy my package to our tenant and am receiving this error
"Invalid SharePoint App package. Error: Part URI is not valid per rules defined in the Open Packaging Conventions specification."
All I have found so far is that the solution cannot be in a folder that contains a space.
This solution doesn't contain spaces.

 

I did a test upload with the stock generated web-parts and it worked fine,

 

But after including JQuery, Moment js and PNP, it doesn't seem to work and gives me the error above.

Any help would be appreciated. 

Im sure I missed something simple but have read the docs atleast a thousand times and cant see where I went wrong.

 

Also checked to see if there was any warnings and fixed all of them still not fixed.
Another thing to note is when I upload to the tenant library without --ship it works fine, but we need it to work without a local host running.


Config contains

 "externals": {
    "jquery": "node_modules/jquery/dist/jquery.min.js",
    "moment": "node_modules/moment/dist/moment.js"
  },

 

  • ganeshsanap's avatar
    ganeshsanap
    Jun 29, 2021

    JaydenMarquardt Then there maybe a space/dash/underscore in the file name of one of the assets. When you deploy with --ship, it includes all client side assets in package.

     

    So, check all the images/css/js/ts/tsx/fonts assets in your solution and remove space/dash/underscore in their names? Did you check this as well?

     

    In one of our solutions there was spaces in image file names which was causing this issue.


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

4 Replies

  • JaydenMarquardt I have faced this issue recently. Try this:

     

    1. Create a new folder at top level in any drive (C or D drive) without spaces or dashes--> Move project solution into this folder. Then use below commands: 

    • gulp clean
    • gulp build
    • gulp bundle --ship
    • gulp package-solution --ship

    2. Remove dashes/spaces/underscores from all the assets (images/css/js) file names.

     

    Above steps helped me to solve my issue. You can also check this GitHub thread: Asset Packaging error when the solution name has - in the name 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • JaydenMarquardt's avatar
      JaydenMarquardt
      Copper Contributor

      Hey ganeshsanap 
      Thanks for you quick response,

       

      As mentioned above I have check all of this and it follows the rules and is sitting at the top of my C drive (Mac os).

      And it works when I deploy without --ship, the error only occurs when I add --ship

      • ganeshsanap's avatar
        ganeshsanap
        MVP

        JaydenMarquardt Then there maybe a space/dash/underscore in the file name of one of the assets. When you deploy with --ship, it includes all client side assets in package.

         

        So, check all the images/css/js/ts/tsx/fonts assets in your solution and remove space/dash/underscore in their names? Did you check this as well?

         

        In one of our solutions there was spaces in image file names which was causing this issue.


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources