Skip to content

Commit

Permalink
fix type error on import.meta.env
Browse files Browse the repository at this point in the history
  • Loading branch information
stramel committed Sep 26, 2024
1 parent 57a42a4 commit 05d358c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"dependencies": {},
"devDependencies": {
"astro": "^4.15.9",
"astro-icon": "../packages/core"
"astro-icon": "workspace:^"
}
}
2 changes: 0 additions & 2 deletions packages/core/src/utils/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ async function fetchCollection(collection: string, { cache }: { cache: FileCache

if (!collectionData) {
const err = new AstroIconError(`Unable to locate the icon collection "${collection}"`);
// @ts-expect-error -- TODO: figure out why this is throwing an error
if (import.meta.env.DEV) {
err.hint = `The "${collection}" icon collection does not exist.\n\nIs this a typo?`;
}
Expand All @@ -59,7 +58,6 @@ export async function getIconData(
const { icons } = collectionData;
if (icons[name] === undefined) {
const err = new AstroIconError(`Unable to locate the icon "${collection}:${name}"`);
// @ts-expect-error -- TODO: figure out why this is throwing an error
if (import.meta.env.DEV) {
err.hint = `The "${collection}" icon collection does not include an icon named "${name}".\n\nIs this a typo?`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"include": ["src", "typings"],
"compilerOptions": {
"allowJs": true,
"module": "NodeNext",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/typings/virtual.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference types="astro/jsx-runtime" />
/// <reference types="astro/client" />

declare module "astro:icons/*" {
type Props = {
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05d358c

Please sign in to comment.