SOLVED

Issue Deploying to tenant app catalog

%3CLINGO-SUB%20id%3D%22lingo-sub-2491433%22%20slang%3D%22en-US%22%3EIssue%20Deploying%20to%20tenant%20app%20catalog%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2491433%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20I%20have%20been%20trying%20to%20deploy%20my%20package%20to%20our%20tenant%20and%20am%20receiving%20this%20error%3CBR%20%2F%3E%22%3CSPAN%3EInvalid%20SharePoint%20App%20package.%20Error%3A%20Part%20URI%20is%20not%20valid%20per%20rules%20defined%20in%20the%20Open%20Packaging%20Conventions%20specification.%22%3CBR%20%2F%3EAll%20I%20have%20found%20so%20far%20is%20that%20the%20solution%20cannot%20be%20in%20a%20folder%20that%20contains%20a%20space.%3CBR%20%2F%3EThis%20solution%20doesn't%26nbsp%3Bcontain%20spaces.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20a%20test%20upload%20with%20the%20stock%20generated%20web-parts%20and%20it%20worked%20fine%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20after%20including%20JQuery%2C%20Moment%20js%20and%20PNP%2C%20it%20doesn't%20seem%20to%20work%20and%20gives%20me%20the%20error%20above.%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20help%20would%20be%20appreciated.%26nbsp%3B%3C%2FP%3E%3CP%3EIm%20sure%20I%20missed%20something%20simple%20but%20have%20read%20the%20docs%20atleast%20a%20thousand%20times%20and%20cant%20see%20where%20I%20went%20wrong.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%20checked%20to%20see%20if%20there%20was%20any%20warnings%20and%20fixed%20all%20of%20them%20still%20not%20fixed.%3CBR%20%2F%3EAnother%20thing%20to%20note%20is%20when%20I%20upload%20to%20the%20tenant%20library%20without%20--ship%20it%20works%20fine%2C%20but%20we%20need%20it%20to%20work%20without%20a%20local%20host%20running.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EConfig%20contains%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%20%22externals%22%3A%20%7B%0A%20%20%20%20%22jquery%22%3A%20%22node_modules%2Fjquery%2Fdist%2Fjquery.min.js%22%2C%0A%20%20%20%20%22moment%22%3A%20%22node_modules%2Fmoment%2Fdist%2Fmoment.js%22%0A%20%20%7D%2C%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2491649%22%20slang%3D%22en-US%22%3ERe%3A%20Issue%20Deploying%20to%20tenant%20app%20catalog%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2491649%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1089582%22%20target%3D%22_blank%22%3E%40JaydenMarquardt%3C%2FA%3E%26nbsp%3BI%20have%20faced%20this%20issue%20recently.%20Try%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Create%20a%20new%20folder%20at%20top%20level%20in%20any%20drive%20(C%20or%20D%20drive)%20without%20%3CSPAN%3Espaces%20or%20dashes%3C%2FSPAN%3E--%26gt%3B%26nbsp%3B%3CSPAN%3EMove%20project%20solution%20into%20this%20folder.%26nbsp%3BThen%20use%20below%20commands%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3Egulp%20clean%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3Egulp%20build%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3Egulp%20bundle%20--ship%3C%2FLI%3E%3CLI%3Egulp%20package-solution%20--ship%3C%2FLI%3E%3C%2FUL%3E%3CP%3E2.%20Remove%20dashes%2Fspaces%2Funderscores%20from%20all%20the%20assets%20(images%2Fcss%2Fjs)%20file%20names.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAbove%20steps%20helped%20me%20to%20solve%20my%20issue.%20You%20can%20also%20check%20this%20GitHub%20thread%3A%26nbsp%3B%3CA%20title%3D%22Asset%20Packaging%20error%20when%20the%20solution%20name%20has%20-%20in%20the%20name%22%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F1130%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAsset%20Packaging%20error%20when%20the%20solution%20name%20has%20-%20in%20the%20name%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%26nbsp%3B%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%26nbsp%3B%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

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"
  },

 

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.

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

best response confirmed by JaydenMarquardt (New Contributor)
Solution

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

Hey @ganeshanap
Thankyou you have solved the issue, there was a single image with a space in it.