Skip to content

Update references to Umbraco User model (Extension Template) #19351

Open
@Rockerby

Description

@Rockerby

Which Umbraco version are you using?

16.0.0-rc2

Bug summary

Model definitions have updated causing the extension template to have build errors.

Specifics

After downloading the latest version of the templates I receive a build error when creating an extension and then building from the Client folder.

The TS build error is:

src/dashboards/dashboard.element.ts:42:9 - error TS18048: 'currentUserContext' is possibly 'undefined'.
src/dashboards/dashboard.element.ts:44:11 - error TS2740: Type 'UmbCurrentUserModel' is missing the following properties from type 'UmbCurrentUserContext': #private, currentUser, load, isUserCurrentUser, and 36 more.

Steps to reproduce

Testing the extensions template with the v16 RC2 lead to issues in the dashboard.

To see the original error you can run the below:

# Create an empty SLN
dotnet new sln --name MySite

# Install latest template
dotnet new install Umbraco.Templates::16.0.0-rc2

# Create a new Umbraco site of 16.0.0-rc2
dotnet new umbraco --name MySite

# Add project to SLN
dotnet sln add MySite

# Change into directory & run
# Go through installer
cd MySite
dotnet run

# Jump out one folder
cd ..

# Run extension template - make note of URL from dotnet run of site
dotnet new umbraco-extension --name MySite.Extensions --include-example --site-domain https://localhost:44348

# Add project to SLN
dotnet sln add MySite.Extensions 

# Add project reference
dotnet add MySite reference MySite.Extensions

I needed to manually update the Umbraco version references in both the package.json (in the MySite.Extensions\Client folder) and the Umbraco version in the MySite.Extensions.csproj to point to v16 RC.

After building I then got the following errors:

src/dashboards/dashboard.element.ts:42:9 - error TS18048: 'currentUserContext' is possibly 'undefined'.
src/dashboards/dashboard.element.ts:44:11 - error TS2740: Type 'UmbCurrentUserModel' is missing the following properties from type 'UmbCurrentUserContext': #private, currentUser, load, isUserCurrentUser, and 36 more.

Expected result / actual result

No errors and the client to build.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions