question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HMR on Android: "TypeError: Attempting to change value of readonly property"

See original GitHub issue

Current Behavior

I’ve followed the HMR setup guide and HMR on Android fails with TypeError: Attempting to change value of readonly property while trying to apply changes. Works totally fine on iOS.

screenshot

Expected Behavior

Should just work like on iOS 😃

Haul Configuration (webpack.haul.js)

const path = require('path')

module.exports = ({ platform }, defaults) => ({
  entry: path.resolve('demo/'),
  resolve: {
    ...defaults.resolve,
    alias: {
      '~': process.cwd(),
    },
  },
})

Your Environment

software version
Haul v1.0.0-beta.13
react-native both 0.52.0 and 0.53.0
node 8.8.1
yarn 1.3.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
sirajulmcommented, Mar 6, 2019

@stackdumper This haul.config.js should fix your issue. Have tested with the sample repo you have provided.

import { createWebpackConfig } from 'haul';
import path from 'path';

export default {
  webpack: (env, defaults) => {
    const config = createWebpackConfig({
      entry: `./index.js`
    })(env);

    config.module.rules = [
      {
        test: /\.js?$/,
        loaders: ['babel-loader']
      },
      ...config.module.rules
    ];

    return config;
  }
};

I assume the babel-loader was not properly applied.

1reaction
deepsweetcommented, Mar 19, 2019

@sirajulm yes, those lines are nothing but a personal choice, main idea is about include array.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Attempting to change value of a readonly property ...
thorws "TypeError: Attempting to change value of a readonly property. defineProperty." when i run code in set top box.
Read more >
TypeError: Attempted to assign to readonly property
Strings are immutable in JavaScript. We can't update them once defined. Hence the error. The solution was to, obviously, call JSON.parse() before updating...
Read more >
Javascript – React: TypeError: Object(…) is not a function in Material ...
So I am trying to use Material UI in my react app. I have tried using Material UI version 0.20.1 and 0.20.0, but...
Read more >
TypeError: Attempted to assign to readonly property. - Reddit
I have created a class for game milestones, with a constructor that gets the type of resource, the amount of that resource, and...
Read more >
Diff - 2f8ce253d268081edd269a1ac2371b743f90bb54^! - platform ...
WinScope: Add prebuilt static copy of winscope and scripts to update the copy Test: cd prebuilts/misc/common/winscope && bash update_winscope.sh Test: open ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found