Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor Server and Css Isolation using .Net 6 + VS Community 2022 #36996

Closed
moehoward opened this issue Sep 27, 2021 · 3 comments
Closed

Blazor Server and Css Isolation using .Net 6 + VS Community 2022 #36996

moehoward opened this issue Sep 27, 2021 · 3 comments
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-css-isolation This issue is related to CSS Isolation feature

Comments

@moehoward
Copy link

moehoward commented Sep 27, 2021

I have two projects:

Sdk="Microsoft.NET.Sdk.Web"
Sdk="Microsoft.NET.Sdk.Razor"

The Blazor Server app (#1) references the Razor library (#2)
and it uses the following markup in its <head> section.

<link href="BlazorApp1.styles.css" rel="stylesheet" />

The Razor library utilizes Css Isolation.
I am getting this error message in the browser's console.

browserLink:77 Uncaught (in promise) TypeError: Cannot read property 'href' of null
    at tt (browserLink:77)
    at nt (browserLink:77)
    at tt (browserLink:77)
    at nt (browserLink:77)
    at tt (browserLink:77)
    at it (browserLink:77)
    at ct.ensureCssUpToDateAsync (browserLink:77)
    at browserLink:71
    at i (browserLink:71)
    at l (browserLink:71)

This error message was not present while using VS 2019 and .NET 5.
The browser's Network tab displays both files.

BlazorApp1.styles.css
RazorApp1.bundle.scp.css

And the BlazorApp1.styles.css contains the proper import.

@import '_content/RazorApp1/RazorApp1.bundle.scp.css';

Any thoughts?
:<)

@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-css-isolation This issue is related to CSS Isolation feature labels Sep 27, 2021
@mkArtakMSFT
Copy link
Member

Thanks for contacting us. This is not part of the runtime feature-set. Please use the VS Feedback to report this issue, so the team who owns the area can track the ask.

@mkArtakMSFT
Copy link
Member

@jodavis FYI

@mkArtakMSFT mkArtakMSFT added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Sep 27, 2021
@jodavis
Copy link

jodavis commented Sep 27, 2021

Thanks for reporting this @moehoward. It would be great if you can report it through VS Feedback so we can track it along with other VS bugs.

This error shouldn't affect any runtime behavior, and it won't show up in production (it will only happen when your project is launched from Visual Studio). So you should be able to ignore it until we can fix it. In the meantime, if it's really bothersome, you can disable Tools->Options->Projects and Solutions->ASP.NET Core->Auto-Sync CSS Changes and the error should go away.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-css-isolation This issue is related to CSS Isolation feature
Projects
None yet
Development

No branches or pull requests

3 participants