# Webpack Watch and Serve with DevKinsta

**URL:** <https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086>\
**Category:** Questions\
**Created:** [October 7, 2024, 12:30pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086 "2024-10-07T12:30:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 7, 2024, 12:30pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/1 "2024-10-07T12:30:56Z")

</div>

Hello Community,

is there any recommendations for a Webpack watch and serve setup?

I am desperately trying to find a way to make it work with a live reload. But facing this kind of an error:

```auto
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes\storefront-child\src\js'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes\storefront-child\fonts\hind'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes\storefront-child\fonts\montserrat'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes\storefront-child\src\scss'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes\storefront-child'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content\themes'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel\wp-content'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public\badspiegel'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta\public'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes\DevKinsta'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker\volumes'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data\docker'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\data'
Watchpack Error (watcher): Error: EISDIR: illegal operation on a directory, watch 'Z:\'

```

Somehow it tries to watch the whole Docker mount?

Kindest regards,

Abidin

---

<div class="post-metadata">

**Author:** ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)\
**Post date:** [October 7, 2024, 1:27pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/2 "2024-10-07T13:27:19Z")

</div>

Hello Abidin 👋

I have to admit I am not certain what is causing this and we’ll need to ask our developers to check.

Can you please send the entire [main.log](https://kinsta.com/docs/devkinsta/devkinsta-troubleshooting/error-codes/#viewing-the-application-log-file) file to us?

Thank you!

Kind regards

---

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 7, 2024, 1:46pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/4 "2024-10-07T13:46:41Z")

</div>

[main.log](https://community.kinsta.com/uploads/short-url/qUDtFyZgel9rjBwLkaQoRdU3820.log) (1001.0 KB)

Main.log file attached. Thank you very much.

---

<div class="post-metadata">

**Author:** ![jackirish](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jackirish/32/1361_2.png) [@jackirish](https://community.kinsta.com/u/jackirish)\
**Post date:** [October 7, 2024, 9:14pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/5 "2024-10-07T21:14:38Z")

</div>

Hi @Imabi ! 👋

It looks like NPM is trying to run on a directory here, instead of files: [node.js - NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native) - Stack Overflow](https://stackoverflow.com/questions/34959038/npm-stuck-giving-the-same-error-eisdir-illegal-operation-on-a-directory-read-a)

Can you please ensure your package.json is looking specifically for files rather than a directory, or provide myself and my colleague @VladimirM with a copy of your package.json via a DM?

---

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 8, 2024, 8:19am UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/6 "2024-10-08T08:19:05Z")

</div>

[webpack.config.js.txt](https://community.kinsta.com/uploads/short-url/nT3vq1UfUoQIAy0dnxpduoAfe0Y.txt) (3.0 KB)  
[package.json.txt](https://community.kinsta.com/uploads/short-url/ugmpHecYV8vToQojSfNPS43obhb.txt) (1.1 KB)

Package.json and Webpack. onfig files attached.

Thank you for your effort to help me with this issue.

---

<div class="post-metadata">

**Author:** ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)\
**Post date:** [October 8, 2024, 10:06am UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/7 "2024-10-08T10:06:05Z")

</div>

Thanks for sending those. We’ll review them and get back to you.

Kind regards,  
Vladimir M

---

<div class="post-metadata">

**Author:** ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)\
**Post date:** [October 9, 2024, 7:12am UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/9 "2024-10-09T07:12:17Z")

</div>

Hello @Imabi

We are not able to determine the cause based on the files you provided as we don’t see the directories referenced in them.

We might need access to your repo though that is out of scope, and this point I can’t guarantee we’ll find an answer, but if there’s anyway we can view the repo, let us know.

Kind regards

---

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 9, 2024, 6:38pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/10 "2024-10-09T18:38:09Z")

</div>

[removed by administrator]

I appreciate your help with this matter, as working with DevKinsta has just started to become fun, and I’m only one step away from perfection. 😁

---

<div class="post-metadata">

**Author:** ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)\
**Post date:** [October 10, 2024, 12:27pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/13 "2024-10-10T12:27:46Z")

</div>

Hello @Imabi

Thanks for sending the files, we are still reviewing them. So far, I can’t see the reason why Watchpack is watching the directories.

If we get anywhere with it, I’ll let you know.

---

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 10, 2024, 1:06pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/14 "2024-10-10T13:06:22Z")

</div>

Thank you very much for your effort.

I’ve noticed the following: When I use polling with a value of 1000 for the regular watcher, the error doesn’t occur.

However, I couldn’t find a way to set up polling for the webpack-dev-server watcher. But what exactly does polling have to do with watching certain files?

---

<div class="post-metadata">

**Author:** ![jackirish](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/jackirish/32/1361_2.png) [@jackirish](https://community.kinsta.com/u/jackirish)\
**Post date:** [October 10, 2024, 9:56pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/15 "2024-10-10T21:56:33Z")

</div>

Hi @Imabi ,

Unfortunately, we haven’t been able to determine what’s causing this from our side. It appears to be specific to Webpack and its configuration. My _guess_ is that because `module.exports` doesn’t specify a list of files to watch, it’s defaulting to trying to watch every file on the pod - possibly because it’s looking at root (/) instead of the application root (./).

I don’t think we’ll be able to give this a proper answer though, because we lack detailed information on how Webpack is actually functioning in this way, and we haven’t been able to replicate this behavior. You may wish to reach out to them, if only to get more information on how exactly it tries to apply its settings in this context.

---

<div class="post-metadata">

**Author:** ![Imabi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/imabi/32/3263_2.png) [@Imabi](https://community.kinsta.com/u/Imabi)\
**Post date:** [October 11, 2024, 5:04pm UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/16 "2024-10-11T17:04:08Z")

</div>

Thank you for the effort though.

I posted a question on Stack Overflow:

> <https://stackoverflow.com/questions/79079143/webpack-watcher-error-eisdir-illegal-operation-on-a-directory-with-wsl2-and>

Let’s see, maybe someone will be able to help. But since this is a very niche problem, I think I might be left alone in this matter. 😢

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/8/80f8c4e56fecc02327a0964e6bf63a716483529f.png) [@system](https://community.kinsta.com/u/system)\
**Post date:** [October 14, 2024, 5:05am UTC](https://community.kinsta.com/t/webpack-watch-and-serve-with-devkinsta/4086/17 "2024-10-14T05:05:06Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
