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

[Bug report] User config dependencies are not watched on windows #611

Closed
richardmward opened this issue Jan 6, 2022 · 4 comments
Closed
Labels
bug Something isn't working os:win32 package:cli

Comments

@richardmward
Copy link

Bug report

Modifying user config dependencies do not trigger the dev server to restart on windows.

Description

resolveDevUserConfig.ts contains a method resolveDeps which does not work on windows because the paths are not in the correct format. The filename passed into the method is in the format C:/dev/src/.../docs/.vuepress/config.js, whereas the require.cache is in the format C:\\dev\\src\\...\\docs\\.vuepress\\config.js.

Steps to reproduce

Create a config.js file which requires another dependency. Modify the dependency. The dev server does not restart.

Expected behavior

The dev server to restart.

Screenshots

Not applicable

Environment info

  • Browser: Firefox
  • Output of vuepress info:
  System:
    OS: Windows 10
  ...
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.32
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.32
    @vuepress/client:  2.0.0-beta.32
    @vuepress/core:  2.0.0-beta.32
    @vuepress/markdown:  2.0.0-beta.32
    @vuepress/plugin-active-header-links:  2.0.0-beta.32
    @vuepress/plugin-back-to-top:  2.0.0-beta.32
    @vuepress/plugin-container:  2.0.0-beta.32
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.32
    @vuepress/plugin-git:  2.0.0-beta.32
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.32
    @vuepress/plugin-nprogress:  2.0.0-beta.32
    @vuepress/plugin-palette:  2.0.0-beta.32
    @vuepress/plugin-prismjs:  2.0.0-beta.32
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search:  2.0.0-beta.32
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.32
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.32
    @vuepress/theme-default:  2.0.0-beta.32
    @vuepress/utils:  2.0.0-beta.32
    vue:  3.2.26
    vue-loader: Not Found
    vue-router:  4.0.12
    vuepress: ^2.0.0-beta.32 => 2.0.0-beta.32
    vuepress-vite:  2.0.0-beta.32
    vuepress-webpack: Not Found
@richardmward
Copy link
Author

I think that it is already using path.normalize earlier in the chain - and that's the issue. The path library being uses always creates linux style paths, whereas require.cache will always use the OS's path style

@richardmward
Copy link
Author

Apologies - I didn't follow your link to the node path lib and assumed you meant the upath lib. In which case, I agree that should hopefully do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os:win32 package:cli
Projects
None yet
Development

No branches or pull requests

3 participants