Error on Publishing Blazor Pilet to Feed Service

198 views Asked by At

I am getting errors when I try to publish my newly developed Piral microservice with Blazor to the development feed service. It's working fine in debug mode though. Below are the steps I followed.

Navigated to the automatically created pilet folder piral~\<pilet-name>

Executed the command to publish the pilet

pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/<feed name> --api-key <api key>

The error I'm getting:

(node:1356) [DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hooks.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)
(node:1356) UnhandledPromiseRejectionWarning: Error: Cannot find module 'E:\Presentations\Microfrontends\demo1\<pilet-name>\bin\Release\net5.0\publish\wwwroot\_framework\blazor.boot.json'
Require stack:
- E:\Presentations\Microfrontends\demo1\piral~\<pilet-name>\src\blazor.codegen

Please note that blazor.boot.json does exists at the above location and all the React pilets that I have created are getting published to the same feed without any issue.

I also tried packing the pilet and uploading it via the web portal. But that also fails without any error message. When investigating, I have noticed that the packed file only contains a package.json inside it.

Edit: I also tried manually packing the pilet using 7zip and uploading it to the feed service. This time it got uploaded, but it's not working. (i.e. the components from that pilet are not getting rendered in the UI) Any help is highly appreciated.

2

There are 2 answers

0
Florian Rappl On

Edit: I also tried manually packing the pilet using 7zip and uploading it to the feed service. This time it got uploaded, but it's not working. (i.e. the components from that pilet are not getting rendered in the UI) Any help is highly appreciated.

Here the format is wrong. The format is a gzipped tarball with the contents aligning to the npm package format (e.g., using a package folder). Use npm pack (or pilet pack) instead.

Please note that blazor.boot.json does exists at the above location and all the React pilets that I have created are getting published to the same feed without any issue.

It may exist, but maybe only at a later point in time. Have you tried to run pilet build first and then do

pilet publish --url https://feed.piral.cloud/api/v1/pilet/<feed name> --api-key <api key>

(note the absence of --fresh)

Does that work?

0
user2216694 On

I found a solution that worked for me.

  1. navigate to the \piral~<pilet-name>\ folder
  2. run command pilet pack
  3. run command pilet publish pilet-name-1.0.0.tgz --url