fsbolero / Bolero

Bolero brings Blazor to F# developers with an easy to use Model-View-Update architecture, HTML combinators, hot reloaded templates, type-safe endpoints, advanced routing and remoting capabilities, and more.
https://fsbolero.io
Apache License 2.0
1.06k stars 53 forks source link

CSS isolation does not work #355

Open masq6r opened 4 months ago

masq6r commented 4 months ago

I followed the document and created a Bolero app but I could not make CSS isolation work because the CssScopes module is not generated.

To reproduce the issue:

  1. Create the project with dotnet new bolera-app.
  2. Check the existence of link { attr.rel "stylesheet"; attr.href "HelloWorld.Client.styles.css" } in Index.fs of HelloWorld.Server.
  3. Check the existence of MyApp.bolero.css of HelloWorld.Client.
  4. Comment the line override _.CssScope = CssScopes.MyApp in Main.fs of HelloWorld.Client, and build the whole solution in VS2022 GUI.
  5. Once the build completed, uncomment the line above and the compiler will give the FS0039 error, CssScopes is not defined.

My dotnet --version is 8.0.204 on Windows 10, Bolero, Bolero.Build, Bolero.Server are 0.23.52.

Tarmil commented 3 months ago

This is strange. I am failing to reproduce the issue (I'm on dotnet 8.0.300).

fwaris commented 3 weeks ago

I think its broken in 8.0.4 (just upgraded) The following global.json fixes it, for now.

{
    "sdk": {
      "version": "8.0.301",
      "rollForward": "disable",
      "allowPrerelease": false
    }
  }
rabejens commented 1 week ago

THis works on the cmdline, but fails in Visual Studio because the newest VS forces using 8.0.4xx despite global.json being set.