Skip to content

Global is Not Defined #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jjcfatras opened this issue Feb 6, 2025 · 3 comments
Open

Global is Not Defined #794

jjcfatras opened this issue Feb 6, 2025 · 3 comments

Comments

@jjcfatras
Copy link

I keep running into this issue on startup. I'm using react-native-web with nextjs (page router) via the @expo/next-adapter https://www.npmjs.com/package/@expo/next-adapter. Attached is a screenshot of the error and of my next.config.js file.

Image

Image

Copy link

Guten Tag, Hans here! 🍻

It looks like you're running into a "Global is Not Defined" issue with your setup. To help mrousavy investigate this, we really need more information. Could you please provide logs from your runtime? If you're using Xcode or Android Studio, you can find them in the logs window or use adb logcat for Android. This will help us understand what's going wrong.

And remember, if you want to support the project and get faster responses, consider sponsoring mrousavy at GitHub Sponsors. Thank you!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

@jjcfatras
Copy link
Author

Does this help?

Image

@wongk
Copy link

wongk commented Apr 17, 2025

I am running into this as well after upgrading MMKV to 3.x from 2.x.

index.js:648 Uncaught ReferenceError: global is not defined
    at isTest (PlatformChecker.js:9:3)
    at new MMKV (MMKV.js:29:83)
    at eval (StorageContext.ts:8:17)
    at (:3000/packages/app/storage/StorageContext.ts (http://localhost:3000/_next/static/chunks/pages/_app.js:20643:1)
    at options.factory (webpack.js:703:31)
    at __webpack_require__ (webpack.js:37:33)
    at fn (webpack.js:360:21)
    at eval (index.ts:2:73)
    at (:3000/packages/app/storage/index.ts (http://localhost:3000/_next/static/chunks/pages/_app.js:20654:1)
    at options.factory (webpack.js:703:31)
    at __webpack_require__ (webpack.js:37:33)
    at fn (webpack.js:360:21)
    at eval (useFeatureFlag.web.ts:6:66)
    at (:3000/packages/app/feature-flags/useFeatureFlag.web.ts (http://localhost:3000/_next/static/chunks/pages/_app.js:19950:1)
    at options.factory (webpack.js:703:31)
    at __webpack_require__ (webpack.js:37:33)
    at fn (webpack.js:360:21)
    at eval (_app.tsx:29:91)
    at (:3000/pages-dir-browser)/src/pages/_app.tsx (http://localhost:3000/_next/static/chunks/pages/_app.js:21423:1)
    at options.factory (webpack.js:703:31)
    at __webpack_require__ (webpack.js:37:33)
    at fn (webpack.js:360:21)
    at eval (next-client-pages-loader.js?absolutePagePath=private-next-pages%2F_app&page=%2F_app!:5:16)
    at eval (route-loader.js:238:51)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants