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

EISDIR on vite build but not on vite - importing an image #2863

Closed
1 task
memoriasIT opened this issue Apr 5, 2021 · 1 comment · Fixed by #2888
Closed
1 task

EISDIR on vite build but not on vite - importing an image #2863

memoriasIT opened this issue Apr 5, 2021 · 1 comment · Fixed by #2888
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@memoriasIT
Copy link

Describe the bug

Adding an image causes the command "vite build" to fail.
Running only "vite" does fine.

Reproduction

A video is provided: DEMO OF BUG STARTING FROM SCRATCH

npm init @vitejs/app
add name and template: vanilla

cd minimalerror
npm install
npm run dev

An image is added to the root folder (I also tried in a folder called Public and it does not work)
Add image to index.html with:
<img src="logo.png" alt="" srcset="">

npm run dev works fine.

npm run build --debug produces the following error

 vite:config no config file found. +0ms
  vite:config using resolved config: {
  vite:config   root: 'D:/Escritorio/Projects/Programming/Javascript/TestingBuildVite/minimalerror',
  vite:config   base: '/',
  vite:config   mode: 'production',
  vite:config   configFile: undefined,
  vite:config   logLevel: undefined,
  vite:config   clearScreen: undefined,
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge18', 'firefox60', 'chrome61', 'safari11' ],
  vite:config     polyfillDynamicImport: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     brotliSize: true,
  vite:config     chunkSizeWarningLimit: 500
  vite:config   },
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   resolve: { dedupe: undefined, alias: [ [Object] ] },
  vite:config   publicDir: 'D:\\Escritorio\\Projects\\Programming\\Javascript\\TestingBuildVite\\minimalerror\\public',
  vite:config   command: 'build',
  vite:config   isProduction: true,
  vite:config   optimizeCacheDir: 'D:\\Escritorio\\Projects\\Programming\\Javascript\\TestingBuildVite\\minimalerror\\node_modules\\.vite',
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:dynamic-import-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter'
  vite:config   ],
  vite:config   server: {},
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   createResolver: [Function: createResolver]
  vite:config } +7ms
vite v2.1.5 building for production...
✓ 0 modules transformed.
[vite:build-html] EISDIR: illegal operation on a directory, read
file: D:/Escritorio/Projects/Programming/Javascript/TestingBuildVite/minimalerror/index.html
error during build:
Error: EISDIR: illegal operation on a directory, read
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! minimalerror@0.0.0 build: `vite build --debug`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the minimalerror@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\memoriasIT\AppData\Roaming\npm-cache\_logs\2021-04-05T17_30_38_051Z-debug.log

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

It did not detect firefox 86

    OS: Windows 10 10.0.18362
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 2.97 GB / 7.89 GB
  Binaries:
    Node: 12.19.0 - D:\ProgramFiles\nodejs\node.EXE
    npm: 6.14.8 - D:\ProgramFiles\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.18362.449.0)
    Internet Explorer: 11.0.18362.1
  npmPackages:
    vite: ^2.1.5 => 2.1.5

Used package manager: npm


Before submitting the issue, please make sure you do the following

  • [ X] Read the Contributing Guidelines.
  • [ X] Read the docs.
  • [ X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [ X] Provide a description in this issue that describes the bug.
  • [X ] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
@patak-dev patak-dev added bug p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Apr 5, 2021
@memoriasIT
Copy link
Author

I created a repository with the minimal project I created.
https://github.com/memoriasIT/ViteJS-IssueDemo

fi3ework added a commit to fi3ework/vite that referenced this issue Apr 6, 2021
fi3ework added a commit to fi3ework/vite that referenced this issue Apr 10, 2021
fi3ework added a commit to fi3ework/vite that referenced this issue Apr 16, 2021
TobiasMelen pushed a commit to TobiasMelen/vite that referenced this issue May 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
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