Skip to content

Commit 9b039c5

Browse files
committed
fix: process.env may not exist on vite.
1 parent 0bd2e06 commit 9b039c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function setLanguage({ lang, messages }: LanguageInterface): string {
138138
* It resolves the language file or data, from direct data, require or Promise.
139139
*/
140140
async function resolveLang(callable: Function, lang: string): Promise<LanguageJsonFileInterface> {
141-
const hasPhpTranslations = process.env.LARAVEL_VUE_I18N_HAS_PHP;
141+
const hasPhpTranslations = process && process.env ? process.env.LARAVEL_VUE_I18N_HAS_PHP : false;
142142
const data = callable(lang)
143143

144144
if (data instanceof Promise) {

0 commit comments

Comments
 (0)