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

Main fails to load if a unreadable directory is present #8916

Closed
7 tasks done
steersbob opened this issue Jul 4, 2022 · 0 comments · Fixed by #9509
Closed
7 tasks done

Main fails to load if a unreadable directory is present #8916

steersbob opened this issue Jul 4, 2022 · 0 comments · Fixed by #9509
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@steersbob
Copy link

steersbob commented Jul 4, 2022

Describe the bug

Problem

If a directory is present somewhere in the repository where current user does not have read rights, an EACCESS error is shown, and the main.js file will not be served.

The index.html, client, and env.mjs files are served correctly, but main.js is stuck in pending state. If I directly navigate to http://localhost:3000/src/main.js, the source code is served as expected.
This reproduces on both Chrome and Firefox.

Related to #5765, but with different symptoms. I can't tell offhand whether this is a regression, or a new manifestation of the same root cause.

Reproduction

yarn create vite repro --template vue
cd repro
yarn

sudo mkdir private
sudo chmod 600 private

yarn dev

Reproduction

See above

System Info

System:
    OS: Linux 5.4 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (8) x64 AMD Ryzen 5 1500X Quad-Core Processor
    Memory: 3.83 GB / 15.62 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.2/bin/yarn
    npm: 8.3.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 101.0.1
  npmPackages:
    @vitejs/plugin-vue: ^2.3.3 => 2.3.3 
    vite: ^2.9.9 => 2.9.13

Used Package Manager

yarn

Logs

2022-07-04T11:11:38.355Z vite:config bundled config file loaded in 34.51ms
2022-07-04T11:11:38.364Z vite:config using resolved config: {
  plugins: [
    'vite:pre-alias',
    'alias',
    'vite:modulepreload-polyfill',
    'vite:resolve',
    'vite:optimized-deps',
    'vite:html-inline-proxy',
    'vite:css',
    'vite:esbuild',
    'vite:json',
    'vite:wasm',
    'vite:worker',
    'vite:asset',
    'vite:vue',
    'vite:define',
    'vite:css-post',
    'vite:worker-import-meta-url',
    'vite:client-inject',
    'vite:import-analysis'
  ],
  server: {
    preTransformRequests: true,
    fs: { strict: true, allow: [Array], deny: [Array] }
  },
  define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false },
  ssr: { external: [ 'vue', '@vue/server-renderer' ] },
  configFile: '/home/steersbob/git/reproduce-readonly-bug/vite.config.js',
  configFileDependencies: [ '/home/steersbob/git/reproduce-readonly-bug/vite.config.js' ],
  inlineConfig: {
    root: undefined,
    base: undefined,
    mode: undefined,
    configFile: undefined,
    logLevel: undefined,
    clearScreen: undefined,
    server: {}
  },
  root: '/home/steersbob/git/reproduce-readonly-bug',
  base: '/',
  resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  publicDir: '/home/steersbob/git/reproduce-readonly-bug/public',
  cacheDir: '/home/steersbob/git/reproduce-readonly-bug/node_modules/.vite',
  command: 'serve',
  mode: 'development',
  isWorker: false,
  isProduction: false,
  build: {
    target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
    polyfillModulePreload: true,
    outDir: 'dist',
    assetsDir: 'assets',
    assetsInlineLimit: 4096,
    cssCodeSplit: true,
    cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
    sourcemap: false,
    rollupOptions: {},
    minify: 'esbuild',
    terserOptions: {},
    write: true,
    emptyOutDir: null,
    manifest: false,
    lib: false,
    ssr: false,
    ssrManifest: false,
    reportCompressedSize: true,
    chunkSizeWarningLimit: 500,
    watch: null,
    commonjsOptions: { include: [Array], extensions: [Array] },
    dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  },
  preview: {
    port: undefined,
    strictPort: undefined,
    host: undefined,
    https: undefined,
    open: undefined,
    proxy: undefined,
    cors: undefined,
    headers: undefined
  },
  env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  assetsInclude: [Function: assetsInclude],
  logger: {
    hasWarned: false,
    info: [Function: info],
    warn: [Function: warn],
    warnOnce: [Function: warnOnce],
    error: [Function: error],
    clearScreen: [Function: clearScreen],
    hasErrorLogged: [Function: hasErrorLogged]
  },
  packageCache: Map(0) {},
  createResolver: [Function: createResolver],
  optimizeDeps: {
    esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  },
  worker: {
    format: 'iife',
    plugins: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    rollupOptions: {}
  }
}

  vite v2.9.13 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 198ms.

2022-07-04T11:11:38.435Z vite:deps scanning for dependencies... { timestamp: true }
EACCES: permission denied, scandir '/home/steersbob/git/reproduce-readonly-bug/private'
2022-07-04T11:11:59.005Z vite:spa-fallback Rewriting GET / to /index.html
2022-07-04T11:11:59.021Z vite:time 17.66ms /index.html
2022-07-04T11:11:59.048Z vite:resolve 1.25ms /src/main.js -> /home/steersbob/git/reproduce-readonly-bug/src/main.js
2022-07-04T11:11:59.051Z vite:resolve 0.49ms /@vite/client -> /home/steersbob/git/reproduce-readonly-bug/node_modules/vite/dist/client/client.mjs
2022-07-04T11:11:59.053Z vite:load 4.32ms [fs] /src/main.js
2022-07-04T11:11:59.061Z vite:resolve 4.14ms vue -> /home/steersbob/git/reproduce-readonly-bug/node_modules/.vite/deps/vue.js?v=79f0c004
2022-07-04T11:11:59.062Z vite:resolve 0.07ms /node_modules/.vite/deps/vue.js?v=79f0c004 -> /home/steersbob/git/reproduce-readonly-bug/node_modules/.vite/deps/vue.js?v=79f0c004
2022-07-04T11:11:59.062Z vite:resolve 0.15ms ./App.vue -> /home/steersbob/git/reproduce-readonly-bug/src/App.vue
2022-07-04T11:11:59.062Z vite:resolve 0.13ms /src/App.vue -> /home/steersbob/git/reproduce-readonly-bug/src/App.vue
2022-07-04T11:11:59.063Z vite:import-analysis 6.31ms [2 imports rewritten] src/main.js
2022-07-04T11:11:59.064Z vite:load 12.14ms [fs] /@vite/client
2022-07-04T11:11:59.069Z vite:resolve 0.27ms @vite/env -> /home/steersbob/git/reproduce-readonly-bug/node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.070Z vite:resolve 0.87ms /node_modules/vite/dist/client/env.mjs -> /home/steersbob/git/reproduce-readonly-bug/node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.071Z vite:import-analysis 4.45ms [1 imports rewritten] node_modules/vite/dist/client/client.mjs
2022-07-04T11:11:59.071Z vite:transform 5.94ms /@vite/client
2022-07-04T11:11:59.072Z vite:time 21.00ms /@vite/client
2022-07-04T11:11:59.073Z vite:load 9.06ms [fs] /src/App.vue
2022-07-04T11:11:59.106Z vite:resolve 0.17ms ./components/HelloWorld.vue -> /home/steersbob/git/reproduce-readonly-bug/src/components/HelloWorld.vue
2022-07-04T11:11:59.106Z vite:resolve 0.09ms /src/components/HelloWorld.vue -> /home/steersbob/git/reproduce-readonly-bug/src/components/HelloWorld.vue
2022-07-04T11:11:59.107Z vite:resolve 0.10ms /src/App.vue?vue&type=style&index=0&lang.css -> /home/steersbob/git/reproduce-readonly-bug/src/App.vue?vue&type=style&index=0&lang.css
2022-07-04T11:11:59.108Z vite:resolve 0.12ms /@id/plugin-vue:export-helper -> null
2022-07-04T11:11:59.108Z vite:hmr [self-accepts] src/App.vue
2022-07-04T11:11:59.109Z vite:import-analysis 4.90ms [4 imports rewritten] src/App.vue
2022-07-04T11:11:59.111Z vite:load 0.79ms [plugin] /src/App.vue?vue&type=style&index=0&lang.css
2022-07-04T11:11:59.113Z vite:load 0.04ms [plugin] plugin-vue:export-helper
2022-07-04T11:11:59.114Z vite:import-analysis 0.03ms [no imports] plugin-vue:export-helper
2022-07-04T11:11:59.114Z vite:transform 0.21ms plugin-vue:export-helper
2022-07-04T11:11:59.114Z vite:load 42.23ms [fs] /node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.115Z vite:import-analysis 0.02ms [no imports] node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.115Z vite:transform 0.28ms /node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.115Z vite:cache [304] /node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.115Z vite:time 0.30ms /node_modules/vite/dist/client/env.mjs
2022-07-04T11:11:59.116Z vite:load 5.47ms [fs] /src/components/HelloWorld.vue
2022-07-04T11:11:59.144Z vite:resolve 0.10ms /src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css -> /home/steersbob/git/reproduce-readonly-bug/src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
2022-07-04T11:11:59.144Z vite:hmr [self-accepts] src/components/HelloWorld.vue
2022-07-04T11:11:59.145Z vite:import-analysis 2.44ms [3 imports rewritten] src/components/HelloWorld.vue
2022-07-04T11:11:59.146Z vite:cache [memory] plugin-vue:export-helper
2022-07-04T11:11:59.146Z vite:load 0.27ms [plugin] /src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
2022-07-04T11:11:59.155Z vite:hmr [self-accepts] src/App.vue?vue&type=style&index=0&lang.css
2022-07-04T11:11:59.155Z vite:import-analysis 0.20ms [0 imports rewritten] src/App.vue?vue&type=style&index=0&lang.css
2022-07-04T11:11:59.155Z vite:transform 43.91ms /src/App.vue?vue&type=style&index=0&lang.css
2022-07-04T11:11:59.159Z vite:hmr [self-accepts] src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
2022-07-04T11:11:59.159Z vite:import-analysis 0.28ms [0 imports rewritten] src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
2022-07-04T11:11:59.159Z vite:transform 12.59ms /src/components/HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css

Validations

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Aug 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants