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

Could not find 'Toolbelt.Head.Title.query' ('Toolbelt' was undefined) but on Blazor WASM and DisableClientScriptAutoInjection = true #25

Open
thepra opened this issue Dec 5, 2021 · 4 comments

Comments

@thepra
Copy link

thepra commented Dec 5, 2021

Hi, I saw the other issue which was about the server side type of project. Here I have a Blazor WASM project and I need offline functionality to work(so no dynamic loading of js).

How am I supposed to accomplish such setup?
As of now I tried with that option disabled and included

<script src="_content/Toolbelt.Blazor.HeadElement.Services/script.min.js"></script>

in the index.html but it doesn't seem to do the trick, what should I do to make it work properly?

@jsakamoto
Copy link
Owner

jsakamoto commented Dec 7, 2021

@thepra Thank you for reporting!

I'll consider the offline scenario that you said.

By the way, I can not work on this issue right now, so I would appreciate it if you waited for my work to be finished.

@jsakamoto
Copy link
Owner

@thepra Thank you for waiting.

Today, I published the new version of "Toolbelt.Blazor.HeadElement" NuGet package.

I improved offline support at this version, so this package version should fix your issue.
Could you try it out?

@thepra
Copy link
Author

thepra commented Feb 11, 2022

yep, with that option disabling client injection and putting the explicit link to the script in the index.html everything seems to work fine now :)

Last piece could be to add such documentation of this feature so people can understand what to do to accomplish offline caching from the beginning

@jsakamoto
Copy link
Owner

@thepra Thank you for replying.
I agree that I should improve the document.
And I'd like to do that as soon as possible.

By the way, in my test case, Blazor WebAssembly apps with PWA manifest and service worker scripts that use this library worked fine on offline mode even though the DisableClientScriptAutoInjection option is not set to true.
(I implemented some extra code explicitly to support those PWA offline scenarios.)

So in my expectation, developers who use this library on their Blazor WebAssembly apps and need PWA offline support may have to do nothing special.
I hope this information is also helpful for you.

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

2 participants