mubaidr / vite-vue3-browser-extension-v3

Another vite powered web extension (chrome, firefox, etc.) starter template.
506 stars 68 forks source link

Build fail after icons are inserted into a template #126

Closed realrecordzLab closed 1 week ago

realrecordzLab commented 1 week ago

I'm trying to use the icons included, but the build will fail because the related icons file are not found.

I've tried to follow the instruction found here to insert icons in my app, but without success.

After the build fail the pnpm build command will stop working and to make it work again it's necessary to do npm i to reinstall the dependencies. Is this a bug or I'm doing something wrong when insert an icon?

mubaidr commented 1 week ago

You don't need to install icon packages, it should auto install. But if it is not working you may try to install related iconify package to dev dependencies.

If it still does not work, please share the code base with me, I will try to help you.

realrecordzLab commented 1 week ago

You don't need to install icon packages, it should auto install. But if it is not working you may try to install related iconify package to dev dependencies.

If it still does not work, please share the code base with me, I will try to help you.

Ok, I will do another test then come back if the problem still persist. Thank you

realrecordzLab commented 1 week ago

@mubaidr here is a sample of the code I have. I've used icones to find the icon then try to import it inside the template but it will not load the icon when the DOM is rendered.

        <button 
          class="btn btn-square w-full px-4 py-4 uppercase"
          @click.prevent="openFileDialog(false)"
        >
          Open File Dialog
          <icon-mdi-movie-search />
        </button>

At this point I'm not sure if I'm importing the icon into the wrong way

realrecordzLab commented 1 week ago

Finally I've found the problem. The IconResolver need to be configured with the desired prefix. The default i seems not working in my case.

mubaidr commented 1 week ago

Finally I've found the problem. The IconResolver need to be configured with the desired prefix. The default i seems not working in my case.

Yeahhhhhh... Looking at your code sample above. I was about to mention the same, glad you found it!