View Full Version : [@extjs/reactor-webpack-plugin]: Error: ENOTEMPTY: directory ... ext-react

13 Sep 2017, 2:07 PM
Using trial version of ExtReact on new windows 10 machine. Used Getting Started "If you prefer to use create-react-app (https://github.com/facebookincubator/create-react-app), see Adding ExtReact to Apps Built With create-react-app (http://docs.sencha.com/extreact/6.5.1/guides/using_create_react_app.html)" method. Worked the first time, but when I shutdown the the server and then restarted it, I was getting the following error:

[@extjs/reactor-webpack-plugin]: Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\joe\Desktop\UI\ExtR\merchant-assistant\build\ext-react\resources\ext\ext-watermark'

I believe that the build script fails when doing a recursive rmdir on /build/ext-react ... and thus the error. If I remove the ext-react dir manually and restart it works once again, until I restart the server again. Is there an update to remedy this.

One note, when following the instructions in the Adding ExtReact to Apps Built With create-react-app (http://docs.sencha.com/extreact/6.5.1/guides/using_create_react_app.html), it ask you to add into webpack.config.dev.js & webpack.config.prod.js underneath plugin: a few lines of code. The problem is their are 3 occurances of plugin in each file, so I guessed and made it the last plugin: in that it was the highest one in the json structure. Is that correct?

14 Sep 2017, 6:52 AM
Yes, you are correct. ExtReactWebpackPlugin should be added to the top-level plugins array. This diff can help clear up any ambiguities: https://github.com/sencha/ext-react-cra-eject/compare/after-eject...with-ext-react

As for the ENOTEMPTY error. I haven't seen that before. Seems like another case of Windows overzealously locking files. Perhaps it has something to do with the way that you're killing the server? Do you get the same problem if you use yeoman and @extjs/generator-ext-react to create an app. It would be nice to know if the problem is specific to ejecting from cra.

14 Sep 2017, 12:00 PM
When I used the yo approach in getting started, npm start and (re)start works just fine. I don't get that build error. I would like to continue to use the CRA approach, so a build patch would be appreciated. :)