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

.Net 6 doesnt work without Startup-Program structure #49

Open
EmilAlipiev opened this issue Mar 24, 2022 · 4 comments
Open

.Net 6 doesnt work without Startup-Program structure #49

EmilAlipiev opened this issue Mar 24, 2022 · 4 comments

Comments

@EmilAlipiev
Copy link

EmilAlipiev commented Mar 24, 2022

I have upgraded my Blazor Wasm application from .net 5 to .net 6. and nothing works. Code below just works fine on .net 5. But once migrated to .net 6 using only Program.cs, not bunding at all. I tried also with fresh new project from VS template and result it the same.
however if i am on .net 6 and if i continue using startup file, it works fine. What could be the deal here? I dont see any exception thrown.

  builder.Services.AddWebOptimizer(pipeline =>
    {
        pipeline.CompileScssFiles();
        pipeline.AddCssBundle("/css/app.css", "/sass/app.scss");
    });

here is a simple repro

BlazorAppWebOptimzer.zip

@EmilAlipiev EmilAlipiev mentioned this issue Mar 25, 2022
@HybridSolutions
Copy link

@EmilAlipiev I think I know what the problem is. You are using Blazor WASM and I'm not quite sure that WebOptimizer is compatible with it. It works with Blazor Server. I checked and don't even see any examples with Blazor Wasm, not even on articles online like this one

Your index.html page is not processed by the server like a regular .cshtml razor page is. Maybe the author can give some feedback on this.

@EmilAlipiev
Copy link
Author

thats right it is with WASM and used to work well with .net 5 although not documented. Stopped working with .Net 6 unfortunately :(

@HybridSolutions
Copy link

While debugging, seems that ExecuteAsync() method is not called or at least debugger not stopping there although it stops in Compiler() constructor method. I believe the issue might be on the main library WebOptimizer and not in WebOptimizer.Sass. Try to create an issue there and mention this.

@szalapski
Copy link

szalapski commented Dec 2, 2022

Would like to see a way to use this with Blazor WebAssembly. Why should Web Optimizer be only for the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants