Coder Social home page Coder Social logo

HMR has some Error! about repack HOT 8 CLOSED

callstack avatar callstack commented on May 27, 2024
HMR has some Error!

from repack.

Comments (8)

OliverNi avatar OliverNi commented on May 27, 2024 1

https://github.com/OliverNi/react-native-app-nativepack
This can be used to reproduce the issue.
The TesterApp in the nativepack repo works for me as well. I also tried to extract to TesterApp to a separate project and changed nativepack to an external dependency and the issue was reproducible in that project as well.

It fails when evaluating the script in loadHmrUpdate so it's pretty difficult to debug.

      if (globalEvalWithSourceUrl) {
        globalEvalWithSourceUrl(script, null);
      } else {
        // Fails here
        eval(script);
      }

from repack.

NiuGuohui avatar NiuGuohui commented on May 27, 2024 1

https://github.com/NiuGuohui/nativepack-issue-29
This repo can be seen this issue.

from repack.

zamotany avatar zamotany commented on May 27, 2024 1

I think I got the fix for it. @OliverNi @NiuGuohui can you update @callstack/nativepack to 1.4.2-beta.0 and check if the issue is gone? Also when testing keep in mind this limitation: https://github.com/callstack/nativepack#hot-module-replacement--react-refresh

from repack.

zamotany avatar zamotany commented on May 27, 2024

Can you post which React Native version you're using?

from repack.

NiuGuohui avatar NiuGuohui commented on May 27, 2024

Can you post which React Native version you're using?

0.64.0

from repack.

OliverNi avatar OliverNi commented on May 27, 2024

I had the same issue before when hermes was disabled.
Try setting enableHermes to true in android/app/build.gradle.

Here's what mine looks like:

project.ext.react = [
    enableHermes: true,
    bundleCommand: "webpack-bundle",
    bundleInDebug: false
]

from repack.

zamotany avatar zamotany commented on May 27, 2024

Can someone create a repro project where this issue can be seen? In TesterApp the HMR works both with and without Hermes on Android.

from repack.

NiuGuohui avatar NiuGuohui commented on May 27, 2024

I think I got the fix for it. @OliverNi @NiuGuohui can you update @callstack/nativepack to 1.4.2-beta.0 and check if the issue is gone? Also when testing keep in mind this limitation: https://github.com/callstack/nativepack#hot-module-replacement--react-refresh

Thank you, the issue has been eliminated.:smile:

from repack.

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.