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

build.lib.entry overwrote build.rollupOptions.input in dev mode #6020

Closed
7 tasks done
ydcjeff opened this issue Dec 9, 2021 · 0 comments · Fixed by #6025
Closed
7 tasks done

build.lib.entry overwrote build.rollupOptions.input in dev mode #6020

ydcjeff opened this issue Dec 9, 2021 · 0 comments · Fixed by #6025

Comments

@ydcjeff
Copy link
Contributor

ydcjeff commented Dec 9, 2021

Describe the bug

When using lib mode, build.lib.entry overwrote build.rollupOptions.input, thus Vite doesn't try to find *.html entry.

This is likely caused by #5601

Reproduction

https://stackblitz.com/edit/vite-jk95bu?file=vite.config.js

System Info

System:
    OS: Linux undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: Unknown - /bin/jsh
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /bin/yarn
    npm: 7.17.0 - /bin/npm
  npmPackages:
    vite: ^2.7.1 => 2.7.1

Used Package Manager

pnpm

Logs

vite:config bundled config file loaded in 271.70ms +0ms
  vite:config using resolved config: {
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: '/home/projects/vite-jk95bu/dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: false,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: { input: '/home/projects/vite-jk95bu/main.js' },
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: {
  vite:config       entry: './main.js',
  vite:config       formats: [Array],
  vite:config       fileName: [Function: fileName]
  vite:config     },
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   server: { fs: { strict: true, allow: [Array], deny: [Array] } },
  vite:config   configFile: '/home/projects/vite-jk95bu/vite.config.js',
  vite:config   configFileDependencies: [ 'vite.config.js' ],
  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     server: { fs: [Object] }
  vite:config   },
  vite:config   root: '/home/projects/vite-jk95bu',
  vite:config   base: '/',
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: '/home/projects/vite-jk95bu/public',
  vite:config   cacheDir: '/home/projects/vite-jk95bu/node_modules/.vite',
  vite:config   command: 'serve',
  vite:config   mode: 'development',
  vite:config   isProduction: false,
  vite:config   plugins: [
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-script-proxy',
  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:client-inject',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) {},
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   }
  vite:config } +11ms
  vite:deps Crawling dependencies using entries:
  vite:deps   /home/projects/vite-jk95bu/main.js +0ms
  vite:resolve 9.30ms unocss -> /home/projects/vite-jk95bu/node_modules/unocss/dist/index.mjs +0ms
  vite:deps Scan completed in 58.30ms: {
  unocss: '/home/projects/vite-jk95bu/node_modules/unocss/dist/index.mjs'
} +58ms
Pre-bundling dependencies:
  unocss
(this will be run only when your dependencies or config have changed)
  vite:resolve 4.80ms @unocss/core -> /home/projects/vite-jk95bu/node_modules/@unocss/core/dist/index.mjs +0ms
  vite:resolve 3.10ms @unocss/preset-uno -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-uno/dist/index.mjs +15ms
  vite:resolve 2.50ms @unocss/preset-attributify -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-attributify/dist/index.mjs +9ms
  vite:resolve 1.50ms @unocss/preset-icons -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-icons/dist/index.mjs +9ms
  vite:resolve 11.50ms @unocss/preset-wind -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-wind/dist/index.mjs +51ms
  vite:resolve 11.20ms @iconify/utils/lib/svg/build -> /home/projects/vite-jk95bu/node_modules/@iconify/utils/lib/svg/build.mjs +0ms
  vite:resolve 7.80ms @iconify/utils/lib/customisations -> /home/projects/vite-jk95bu/node_modules/@iconify/utils/lib/customisations/index.mjs +20ms
  vite:resolve 8.80ms @unocss/preset-mini -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-mini/dist/index.mjs +15ms
  vite:resolve 8.80ms @iconify/utils/lib/icon-set/get-icon -> /home/projects/vite-jk95bu/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +1ms
  vite:resolve 4.10ms @unocss/preset-mini/utils -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-mini/dist/utils.mjs +36ms
  vite:resolve 1.90ms fs -> __vite-browser-external:fs +0ms
  vite:resolve 16.30ms fs -> __vite-browser-external:fs +27ms
  vite:resolve 22.20ms @unocss/preset-mini/rules -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-mini/dist/rules.mjs +23ms
  vite:resolve 1.60ms local-pkg -> /home/projects/vite-jk95bu/node_modules/local-pkg/index.cjs +42ms
  vite:resolve 1.60ms local-pkg -> /home/projects/vite-jk95bu/node_modules/local-pkg/index.mjs +6ms
  vite:resolve 3.40ms @unocss/preset-mini/variants -> /home/projects/vite-jk95bu/node_modules/@unocss/preset-mini/dist/variants.mjs +12ms
  vite:resolve 0.70ms path -> __vite-browser-external:path +24ms
  vite:resolve 0.80ms path -> __vite-browser-external:path +17ms
  vite:resolve 1.90ms mlly -> /home/projects/vite-jk95bu/node_modules/mlly/lib/index.mjs +32ms
  vite:resolve 1.00ms url -> __vite-browser-external:url +110ms
  vite:resolve 3.60ms node:path -> __vite-browser-external:node:path +112ms
  vite:resolve 0.90ms node:process -> __vite-browser-external:node:process +29ms
  vite:resolve 1.70ms node:fs -> __vite-browser-external:node:fs +10ms
  vite:resolve 0.80ms process -> __vite-browser-external:process +91ms
  vite:resolve 2.20ms node:url -> __vite-browser-external:node:url +39ms
  vite:resolve 2.60ms node:module -> __vite-browser-external:node:module +0ms
  vite:resolve 4.30ms import-meta-resolve -> /home/projects/vite-jk95bu/node_modules/import-meta-resolve/index.js +13ms
  vite:resolve 1.20ms url -> __vite-browser-external:url +37ms
  vite:resolve 1.50ms builtins -> /home/projects/vite-jk95bu/node_modules/builtins/index.js +31ms
  vite:resolve 2.00ms assert -> __vite-browser-external:assert +19ms
  vite:resolve 2.00ms semver -> /home/projects/vite-jk95bu/node_modules/semver/index.js +130ms
  vite:resolve 7.00ms util -> __vite-browser-external:util +28ms
  vite:resolve 1.50ms lru-cache -> /home/projects/vite-jk95bu/node_modules/lru-cache/index.js +150ms
  vite:resolve 1.20ms yallist -> /home/projects/vite-jk95bu/node_modules/yallist/yallist.js +21ms
 > node_modules/mlly/lib/_utils.mjs:1:9: error: No matching export in "browser-external:node:module" for import "builtinModules"
    1 │ import { builtinModules } from 'node:module'~~~~~~~~~~~~~~

 > node_modules/mlly/lib/utils.mjs:2:9: error: No matching export in "browser-external:node:url" for import "fileURLToPath"
    2 │ import { fileURLToPath as _fileURLToPath } from 'node:url'~~~~~~~~~~~~~

 > node_modules/mlly/lib/utils.mjs:3:9: error: No matching export in "browser-external:node:fs" for import "promises"
    3 │ import { promises as fsp } from 'node:fs'~~~~~~~~

 > node_modules/mlly/lib/cjs.mjs:2:9: error: No matching export in "browser-external:node:module" for import "createRequire"
    2 │ import { createRequire } from 'node:module'~~~~~~~~~~~~~

 > node_modules/mlly/lib/cjs.mjs:3:9: error: No matching export in "browser-external:node:path" for import "dirname"
    3 │ import { dirname } from 'node:path'~~~~~~~

 > node_modules/import-meta-resolve/lib/errors.js:6:8: error: No matching export in "browser-external:url" for import "URL"
    6 │ import {URL} from 'url'~~~

 > node_modules/import-meta-resolve/lib/errors.js:7:8: error: No matching export in "browser-external:util" for import "format"
    7 │ import {format, inspect} from 'util'~~~~~~

 > node_modules/import-meta-resolve/lib/errors.js:7:16: error: No matching export in "browser-external:util" for import "inspect"
    7 │ import {format, inspect} from 'util'~~~~~~~

 > node_modules/import-meta-resolve/lib/get-format.js:4:8: error: No matching export in "browser-external:url" for import "URL"
    4 │ import {URL, fileURLToPath} from 'url'~~~

 > node_modules/import-meta-resolve/lib/get-format.js:4:13: error: No matching export in "browser-external:url" for import "fileURLToPath"
    4 │ import {URL, fileURLToPath} from 'url'~~~~~~~~~~~~~

 > node_modules/import-meta-resolve/lib/resolve.js:21:8: error: No matching export in "browser-external:url" for import "URL"
    21 │ import {URL, fileURLToPath, pathToFileURL} from 'url'~~~

 > node_modules/import-meta-resolve/lib/resolve.js:21:13: error: No matching export in "browser-external:url" for import "fileURLToPath"
    21 │ import {URL, fileURLToPath, pathToFileURL} from 'url'~~~~~~~~~~~~~

 > node_modules/import-meta-resolve/lib/resolve.js:21:28: error: No matching export in "browser-external:url" for import "pathToFileURL"
    21 │ import {URL, fileURLToPath, pathToFileURL} from 'url'~~~~~~~~~~~~~

 > node_modules/import-meta-resolve/lib/resolve.js:22:8: error: No matching export in "browser-external:fs" for import "Stats"
    22 │ import {Stats, statSync, realpathSync} from 'fs'~~~~~

 > node_modules/import-meta-resolve/lib/resolve.js:22:15: error: No matching export in "browser-external:fs" for import "statSync"
    22 │ import {Stats, statSync, realpathSync} from 'fs'~~~~~~~~

 > node_modules/import-meta-resolve/lib/resolve.js:22:25: error: No matching export in "browser-external:fs" for import "realpathSync"
    22 │ import {Stats, statSync, realpathSync} from 'fs'~~~~~~~~~~~~

 > node_modules/mlly/lib/resolve.mjs:1:9: error: No matching export in "browser-external:node:fs" for import "realpathSync"
    1 │ import { realpathSync } from 'node:fs'~~~~~~~~~~~~

 > node_modules/mlly/lib/resolve.mjs:3:9: error: No matching export in "browser-external:node:url" for import "pathToFileURL"
    3 │ import { pathToFileURL } from 'node:url'~~~~~~~~~~~~~

 > node_modules/local-pkg/dist/shared.mjs:54:9: error: No matching export in "browser-external:fs" for import "existsSync"
    54 │ import { existsSync, promises as fs3 } from "fs";~~~~~~~~~~

 > node_modules/local-pkg/dist/shared.mjs:54:21: error: No matching export in "browser-external:fs" for import "promises"
    54 │ import { existsSync, promises as fs3 } from "fs";~~~~~~~~

 > node_modules/local-pkg/dist/shared.mjs:62:13: error: No matching export in "browser-external:node:fs" for import "promises"
    62 │ import fs, { promises as fsPromises } from "node:fs";~~~~~~~~

 > node_modules/local-pkg/dist/shared.mjs:235:14: error: No matching export in "browser-external:node:fs" for import "promises"
    235 │ import fs2, { promises as fsPromises2 } from "node:fs";~~~~~~~~

 > node_modules/local-pkg/index.mjs:1:9: error: No matching export in "browser-external:path" for import "join"
    1 │ import { join, dirname } from 'path'~~~~

 > node_modules/local-pkg/index.mjs:1:15: error: No matching export in "browser-external:path" for import "dirname"
    1 │ import { join, dirname } from 'path'~~~~~~~

 > node_modules/local-pkg/index.mjs:2:9: error: No matching export in "browser-external:fs" for import "promises"
    2 │ import { promises as fs, existsSync } from 'fs'~~~~~~~~

 > node_modules/local-pkg/index.mjs:2:25: error: No matching export in "browser-external:fs" for import "existsSync"
    2 │ import { promises as fs, existsSync } from 'fs'~~~~~~~~~~

 > node_modules/@unocss/preset-icons/dist/fs.mjs:1:9: error: No matching export in "browser-external:fs" for import "promises"
    1 │ import { promises } from 'fs';~~~~~~~~

error when starting dev server:
Error: Build failed with 27 errors:
node_modules/@unocss/preset-icons/dist/fs.mjs:1:9: error: No matching export in "browser-external:fs" for import "promises"
node_modules/import-meta-resolve/lib/errors.js:6:8: error: No matching export in "browser-external:url" for import "URL"
node_modules/import-meta-resolve/lib/errors.js:7:8: error: No matching export in "browser-external:util" for import "format"
node_modules/import-meta-resolve/lib/errors.js:7:16: error: No matching export in "browser-external:util" for import "inspect"
node_modules/import-meta-resolve/lib/get-format.js:4:8: error: No matching export in "browser-external:url" for import "URL"
...
    at failureErrorWithLog (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:1493:15)
    at eval (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:1151:28)
    at runOnEndCallbacks (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:941:63)
    at buildResponseToResult (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:1149:7)
    at eval (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:1258:14)
    at eval (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:629:9)
    at handleIncomingPacket (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/home/projects/vite-jk95bu/node_modules/esbuild/lib/main.js:596:7)
    at Socket.EventEmitter.emit (https://vite-jk95bu.w.staticblitz.com/blitz.6c82f838340a5d37c50f004ca724bcc8f75bc71c.js:6:126633)
    at addChunk (https://vite-jk95bu.w.staticblitz.com/blitz.6c82f838340a5d37c50f004ca724bcc8f75bc71c.js:6:499986)

Validations

@ydcjeff ydcjeff changed the title build.lib.entry overwrote build.rollupOptions.input build.lib.entry overwrote build.rollupOptions.input in dev mode Dec 9, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant