The glob option "as" has been deprecated in favour of "query"
Terminal warn:
WARN The glob option "as" has been deprecated in favour of "query". Please update as: 'raw' to query: '?raw', import: 'default'.
any update so far ?
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
@gitFoxCode Would it help you if we create a PR for this?
@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
Ok I see. Thank you for your super fast answer!
Hello, I see from the source code that the issue has been resolved. Can the author release a version to update it? @gitFoxCode
I've been trying to understand where the heck this message has been coming from for AGES. 😂
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;
}
}
]
},
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” });