nuxt-icons icon indicating copy to clipboard operation
nuxt-icons copied to clipboard

The glob option "as" has been deprecated in favour of "query"

Open carvalhoms opened this issue 1 year ago • 9 comments

Terminal warn:

WARN The glob option "as" has been deprecated in favour of "query". Please update as: 'raw' to query: '?raw', import: 'default'.

carvalhoms avatar Apr 18 '24 01:04 carvalhoms

any update so far ?

jukbot avatar Jun 28 '24 18:06 jukbot

any update so far ?

Still not, but official nuxt/icon module now support local icons collection as svg files, not only components and also have REAL aspect ratio, not a square. Im migrate to it just today

Schllimazll avatar Jun 28 '24 22:06 Schllimazll

@gitFoxCode Would it help you if we create a PR for this?

AdrianFahrbach avatar Sep 16 '24 20:09 AdrianFahrbach

@gitFoxCode Would it help you if we create a PR for this?

Hey, yes, I'll add this PR then to the module, but in general I recommend to use nuxt-icon because it also already supports local icons and it's up-to-date + support by nuxt authors

gitFoxCode avatar Sep 16 '24 21:09 gitFoxCode

Ok I see. Thank you for your super fast answer!

AdrianFahrbach avatar Sep 16 '24 21:09 AdrianFahrbach

Hello, I see from the source code that the issue has been resolved. Can the author release a version to update it? @gitFoxCode

topwait avatar Oct 17 '24 09:10 topwait

I've been trying to understand where the heck this message has been coming from for AGES. 😂

armenr avatar Nov 04 '24 04:11 armenr

I also can see this warning popping up in the terminal. Any chance to provide an update?

My current work-around adds thee lines to the muxt.config:


  vite: {
    plugins: [
      {
        name: 'vite-plugin-glob-transform',
        transform(code: string, id: string) {
          if (id.includes('nuxt-icons')) {
            return code.replace(/as:\s*['"]raw['"]/g, 'query: "?raw", import: "default"');
          }
          return code;
        }
      }
    ]
  },

rowild avatar Nov 05 '24 18:11 rowild

This was happening to me when executing the line below. It has to do with the import.meta.glob:

const articleFiles = import.meta.glob(“../content/articles/*.md”, { eager: true, as: “raw” });

The error was fixed by changing to:

const articleFiles = import.meta.glob(“../content/articles/*.md”, { eager: true, query: “?raw”, import: “default” });

pelayotrives avatar Apr 24 '25 04:04 pelayotrives