milankinen / livereactload

Live code editing with Browserify and React
MIT License
865 stars 61 forks source link

aborts with external dependencies #117

Closed younes0 closed 8 years ago

younes0 commented 8 years ago

with the following grunt browserify config:

browserify: {
  options: {
    transform: [
        ['babelify', { presets: [ 'es2015', 'react' ]}],
    ],
    plugin: [ 'livereactload', ],
    extensions: ['.jsx'],
   },
  app: {
    src:  jsDir + '/App/Routes.js',
    dest: publicDir + 'js/app.js',  
    options: {
        external: reactVendor, // ['react', 'react-dom'] // etc
    }
  },
  vendor: {
    src: ['.'],
    dest: publicDir + 'js/vendor.js',
    options: {
        alias: reactVendor.map(function(module) {
            return module + ':';
        }),
    },
  },
}

I get the following error:

LiveReactload :: Apply patch
> Patch module    :: /www/app/resources/assets/js/App/ReactComponents/Member.jsx
Error: No react(…)(anonymous function) @ VM17437:78handleChanges @ VM17437:53change @ ws.onmessage 
LiveReactload :: Abort patching

Members.jsx requires 'react' which is present in vendor.js Could be external parameter be ignored ?

milankinen commented 8 years ago

This is definitely a bug. Fortunately fix is simple.

Thanks!