GithubHelp home page GithubHelp logo

Comments (35)

mackenziemance avatar mackenziemance commented on April 26, 2024 8

@richardgirges Any updates on this ?

from metro.

bnjm avatar bnjm commented on April 26, 2024 7

@PvanHengel updating to RN 0.50.3 fixed this for me... hopefully fixes for you too.

from metro.

blackxored avatar blackxored commented on April 26, 2024 5

Can confirm that 0.50.2 has this error. It only happens on release build for me though.

from metro.

zuoge85 avatar zuoge85 commented on April 26, 2024 4

+1

from metro.

PvanHengel avatar PvanHengel commented on April 26, 2024 3

We are seeing the same release build issue in ios, we didn't have any issues with the debug build. The Unhandled JS Exception: undefined is not an object (evaluating 'e.length')', reason: 'Unhandled JS Exception: undefined is not an object (evaluating 'e.length') is a major blocker, do we need to open another issue for that here, or should we keep this one open?

from metro.

JumalDB avatar JumalDB commented on April 26, 2024 2

It seems to fix Debug build (which can be run on ios devices now), however there is another Release build issue now:
facebook/react-native#16745

from metro.

SSTPIERRE2 avatar SSTPIERRE2 commented on April 26, 2024 1

Upgrading to RN 0.50.3 fixed this same issue for me too with a new project created this week! I hope upgrading fixes this for you all as well, and if you haven't done it before here's the doc: https://facebook.github.io/react-native/docs/upgrading.html cheers!

from metro.

DiederikvandenB avatar DiederikvandenB commented on April 26, 2024 1

I'm on 0.50.3 and I am still experiencing this issue.

from metro.

flylxq avatar flylxq commented on April 26, 2024 1

On 0.50.4 I am having this issue.
b27493c0-ccaa-4671-ae19-a770232e1233

from metro.

rafeca avatar rafeca commented on April 26, 2024 1

Thanks @nsipplswezey for shedding some light. In fact, package manager lock files will prevent updating to the metro version that fixed this issue (v0.20.3).

For anyone stumbling across this issue, remove the metro entry in your package-lock.json/yarn.lock file and npm install/yarn install again

from metro.

glarivie avatar glarivie commented on April 26, 2024 1

On RN0.50.4, with [email protected] I am having this issue.

from metro.

rafeca avatar rafeca commented on April 26, 2024 1

Ok, I've just actually been able to reproduce it, a fix is coming

from metro.

tqc avatar tqc commented on April 26, 2024

I ran into that one last week. It seems to be related to the order things get packaged in - react native polyfills process.env, but does it after react tries to check if it is running in dev mode.

Putting the first RN import before the first react import seems to have fixed it, but it was working fine the other way around on previous versions.

from metro.

cpojer avatar cpojer commented on April 26, 2024

Would be good to figure out which module is throwing this.

from metro.

tqc avatar tqc commented on April 26, 2024

In my case it was react - unlike #65 it’s not just a bundler setting/ error message. Were previous releases perhaps effectively hardcoded to load react native before anything else?

from metro.

brunocascio avatar brunocascio commented on April 26, 2024

Please, take a look at this issue.

from metro.

fungilation avatar fungilation commented on April 26, 2024

Since moment is reverting their fix, a fix in Bundler would be appreciated!

from metro.

tsyeyuanfeng avatar tsyeyuanfeng commented on April 26, 2024

process is set up in InitializeCore module of react-native.

// InitializeCore.js
// Set up process
global.process = global.process || {};
global.process.env = global.process.env || {};
if (!global.process.env.NODE_ENV) {
  global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production';
}

So InitializeCore module must run before entry module. Previously, runBeforeMainModule config was specified in defaults.js where InitializeCore is included. But it has been removed from metro-bundler in this commit Make the runBeforeMainModule config param to RN repo and make it absolute recently. However, it seems that there are some problems with this commit, I've created another issue #78 to disscus about this.

from metro.

tqc avatar tqc commented on April 26, 2024

@tsyeyuanfeng That would explain why things suddenly stopped working.

See also the corresponding RN commit facebook/react-native@34487c0

Looks like that commit isn’t part of 0.49, but is tagged as v0.50.0-rc0 - it will work just fine with facebook’s internal setup (master of both in a single repo) but the open source dependencies are broken at the moment.

from metro.

amardeepranu avatar amardeepranu commented on April 26, 2024

Getting this error when trying to run on a device on RN v0.50.2

from metro.

JumalDB avatar JumalDB commented on April 26, 2024

I have this issue too on 0.50.2. Is there any workarounds?

from metro.

rafeca avatar rafeca commented on April 26, 2024

We have just released metro-bundler v0.20.2, which should solve this issue. Can somebody confirm?

from metro.

JumalDB avatar JumalDB commented on April 26, 2024

RN 0.50.3 does not fix that another issue:
Unhandled JS Exception: undefined is not an object (evaluating 'e.length')

from metro.

PvanHengel avatar PvanHengel commented on April 26, 2024

@JuliusMalisauskasDB see facebook/react-native#16745 it is related to an issue which has been merged with the color-convert library. I believe the fix was merged.

from metro.

rmevans9 avatar rmevans9 commented on April 26, 2024

@JuliusMalisauskasDB I resolved this issue with a yarn resolution to set color-convert to 1.9.1. There are a few libraries that seem to depend specifically on 1.9.0. For me it was react-native-svg

from metro.

rafeca avatar rafeca commented on April 26, 2024

Can you check which version of metro-bundler are you using? To do so, check for the metro-bundler entry on your yarn.lock file.

This issue was fixed in v0.20.2

from metro.

nsipplswezey avatar nsipplswezey commented on April 26, 2024

Ran into the same error with a fresh clone+build of a previously functional project.

    "dependencies": {
        "react": "16.0.0",
        "react-native": "0.50.4"
    },

Did an rm yarn.lock and rm package-lock.json and an npm i.
Now my package-lock.json is:

        "metro-bundler": {                                                      
            "version": "0.20.3",
            "resolved": "https://registry.npmjs.org/metro-bundler/-/metro-bundler-0.20.3.tgz",

Though my node_modules/react-native/package.json shows

    "metro-bundler": "^0.20.1",  

Regardless I'm back up and running.
For anyone else stuck on this, my issue seemed to be an old yarn.lock file from maybe from an old yarn install, when currently I'm using npm install.

from metro.

rafeca avatar rafeca commented on April 26, 2024

@hqro are you sure that the metro version that you're using is 0.20.3? Can you post the whole error stack trace you're getting?

from metro.

leavesster avatar leavesster commented on April 26, 2024

run react-native upgrade and close proxy(I don't think the proxy is the problem , but these are two things I done, after I have this issue) fix this problem.

My version:

react-native -v
react-native-cli: 2.0.1
react-native: 0.50.1

from metro.

glarivie avatar glarivie commented on April 26, 2024

@rafeca this is my yarn.lock

metro-bundler@^0.20.1, metro-bundler@^0.20.3:
  version "0.20.3"
  resolved "https://registry.yarnpkg.com/metro-bundler/-/metro-bundler-0.20.3.tgz#0ded01b64e8963117017b106f75b83cfc34f3656"

from metro.

albertobram avatar albertobram commented on April 26, 2024

I am running into this issue as well, I have these versions of the components:
metro-bundler 0.20.3
react 16.0.0
react-native 0.50.3

from metro.

janicduplessis avatar janicduplessis commented on April 26, 2024

@rafeca Just hit this issue with [email protected]. It only happens when generating a prod bundle. Looking at the bundle a module that uses process.env (in my case invariant) appears before the InitializeCore module. This causes it to be executed before process.env polyfill is setup. As a workaround I added import 'InitializeCore'; at the top of my index.js and now it works.

from metro.

rafeca avatar rafeca commented on April 26, 2024

Hey @janicduplessis! Are you trying it with RN master?

I cannot repro it in my silly sample RN app: https://github.com/rafeca/rn-test-app if you have some repro steps I can take a deeper look

from metro.

leai-jiang avatar leai-jiang commented on April 26, 2024

Also have this issue on react-native 0.52

from metro.

fungilation avatar fungilation commented on April 26, 2024

Works for me on 0.52.

from metro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.