Custom Packages causing errors

Hi all,

I’ve got a couple of custom packages that I’ve created and for a while now I’ve been getting errors when I run my site locally and I log in to the backoffice.
The packages work but it would be nice not to have a terminal full or red and yellow messages. I’ve no idea why I get these errors or when they started to appear so I’m hoping some of you clever lot can point me in the right direction.

When I do a npm run build on each individual package, I get zero issues, no warnings or errors, but when I run the site locally, I guess something goes on where Umbraco will register the packages. Once I log in to the backoffice, that’s when I get the screen below.

As I say, the packages work fine but clearly I’ve done something wrong and it would be nice to tidy this up.

My solution looks like this :

The errors I get are :

Any more info needed, just ask.

Heya Owain
My guess is that perhaps you might need to update your NPM dependencies to match align with the version of the site it’s being used in.

But from the error message it’s a bit hard to say what’s going on.

Morning @OwainWilliams!

Have you followed steps 7-8 of the Vite Package Setup docs? (assuming you’re using Vite and TypeScript from what I can see in the errors)

7. Open the tsconfig.json file.

8. Add the array types inside compilerOptions, with the entry of @umbraco-cms/backoffice/extension-types:

{
  "compilerOptions": {
    ...
    "types": [
      “@umbraco-cms/backoffice/extension-types”
    ]
  }
}

This should help the TS compile “find” the correct types. You may also need to follow step 9 on there too to stop all of the @umbraco packages being bundled into your final build.

1 Like

Hi Rick,
Thanks - I used Lottes starter kit for the packages and yes, I’ve got that setup. I wonder if it’s due to having two packages setup?

ye, from what I can tell, everything is matching, it’s an odd one and really annoying me :smiley: