Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore the error that directoryPath is not a directory #226

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

liximomo
Copy link

@liximomo liximomo commented Dec 12, 2022

The error is caused by a specific alias config of webpack, considering the following example:

// webpack.config.js
module.exports = {
  resolve: {
    alias:  {
       "@/foo": ["src/foo/index", "src/foo"] 
     }
  }
}

With the above config, we will get a DirectoryWatcher watching src/foo/index. If you happen to have a src/foo file on your filesystem, you will see the error:

Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/Users/xx/demo/src/foo'

We could safely ignore the error of ENOTDIR in whatever cases.

Related Issues:
nuxt/bridge#226

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 12, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: liximomo / name: X.L (fe84a8b)

@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 92.12% // Head: 78.11% // Decreases project coverage by -14.00% ⚠️

Coverage data is based on head (9ccfcf3) compared to base (dc690bb).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #226       +/-   ##
===========================================
- Coverage   92.12%   78.11%   -14.01%     
===========================================
  Files           6        6               
  Lines        1041     1042        +1     
  Branches      249      250        +1     
===========================================
- Hits          959      814      -145     
- Misses         82      228      +146     
Flag Coverage Δ
integration 78.11% <0.00%> (-14.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/DirectoryWatcher.js 91.06% <0.00%> (-1.51%) ⬇️
lib/reducePlan.js 2.98% <0.00%> (-92.54%) ⬇️
lib/watchEventSource.js 47.69% <0.00%> (-38.47%) ⬇️
lib/watchpack.js 92.14% <0.00%> (-0.83%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant