Skip to content

Commit

Permalink
fix: remove isBrowser check error (#451)
Browse files Browse the repository at this point in the history
* fix: remove `isBrowser` check error

* ci: fix CI name

* fix: config path

* fix: remove path
  • Loading branch information
ashgw authored Jan 17, 2025
1 parent fb9b523 commit 7accb8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# this auto labels PRs based on the configuration file
# have a look at ./github/labeler.yml`
name: CI

on:
- pull_request_target
Expand All @@ -17,4 +18,3 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
configuration-path: ./github/labeler.yml
5 changes: 3 additions & 2 deletions packages/env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { createEnv } from "@ashgw/ts-env";

config({ path: require("path").resolve(__dirname, "../../.env") });

const isBrowser = typeof window !== "undefined";

export const env = createEnv({
vars: {
NODE_ENV: z.enum(["production", "development", "preview"]),
Expand All @@ -15,6 +17,5 @@ export const env = createEnv({
},
disablePrefix: ["NODE_ENV"],
prefix: "NEXT_PUBLIC",
// @ts-expect-error skip in browser
skipValidation: typeof window === "undefined" ? false : true,
skipValidation: isBrowser,
});
1 change: 1 addition & 0 deletions packages/env/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "@ashgw/tsconfig/base.json",
"include": ["."],
"compilerOptions": { "lib": ["DOM", "ES2022"] },
"exclude": ["node_modules"]
}

0 comments on commit 7accb8c

Please sign in to comment.