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

Not loading cached vuetify material icons when offline #278

Open
kfung21 opened this issue Sep 5, 2024 · 8 comments
Open

Not loading cached vuetify material icons when offline #278

kfung21 opened this issue Sep 5, 2024 · 8 comments

Comments

@kfung21
Copy link

kfung21 commented Sep 5, 2024

Description 📖

Vuetify material icons load correctly when online. When offline, the material icons aren't displaying despite being correctly cached.

Reproduction 🐞

https://www.penpublic.com/

</details>

### Logs 📜

_If not providing a reproduction:_

<details>
<summary>Output</summary>

_Run `DEBUG=iles:* npm run dev` or `DEBUG=iles:* npm run build` and provide the output:_

</details>

### Screenshots 📷

_Provide console or browser screenshots of the problem_.

@TechAkayy
Copy link
Collaborator

Are you able to share your repo? Hard to debug without code. I'm guessing you are referring to pwa?

@kfung21
Copy link
Author

kfung21 commented Sep 5, 2024 via email

@ouuan
Copy link
Contributor

ouuan commented Sep 5, 2024

I can share a few modules but rather not disclose the entire app if that's ok .

You are encouraged to provide as little code as possible, as long as it is self-contained and the bug can be reproduced. i.e. You can provide a Minimal, Reproducible Example

@kfung21
Copy link
Author

kfung21 commented Sep 5, 2024 via email

@TechAkayy
Copy link
Collaborator

TechAkayy commented Sep 6, 2024

Thanks for sharing. Next time, when sharing code, please select your code block & wrap it within a pair of triple tilde's (new lines before and after your code block like below image), this helps with code highlight & makes it's scrollable when you submit your comment.

image

I notice that yours is a Vite based project, as you have shared a vite config, and not an Iles one? I don't see any Iles specific code in what you have shared, can you please confirm if it's an Iles project?

Even if it's still an Iles project and somehow vite config is getting used instead of iles config file, there is a better chance of getting any help on this if you raise this issue in the vite-plugin-pwa repo, as this is a pwa related query, and you were able to share only certain configs here.

@kfung21
Copy link
Author

kfung21 commented Sep 6, 2024 via email

@userquin
Copy link
Collaborator

userquin commented Sep 6, 2024

if you're using íles + pwa check https://iles-docs.netlify.app/guide/pwa

@TechAkayy
Copy link
Collaborator

TechAkayy commented Sep 6, 2024

@kfung21, no worries. By the way, I would recommend dropping materialdesignicons.css and instead use css icons with unocss. You might end up using say 10 icons when using materialdesignicons.css, but the whole css will be included in your built bundle, and it's not treeshaken.

Here is a very simple vue-vuetify template that does it - https://github.com/pinegrow/pg-vue-vuetify. It uses a small hack to use unocss icons for vuetify components as well - https://github.com/Pinegrow/pg-vue-vuetify/blob/main/vuetify.config.ts#L101. Unocss nicely treeshakes unused icons.

You will be surprised to find how much weight you shed in your final bundle. Not sure if this solves your current issue (I guess it will 😉), but give it a shot.

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

4 participants