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 overwrites build.rollupOptions.input in v3 #9086

Closed
7 tasks done
SteveDesmond-ca opened this issue Jul 13, 2022 · 1 comment · Fixed by agrc/kitchen-sink#125 or #10116
Closed
7 tasks done

build.lib overwrites build.rollupOptions.input in v3 #9086

SteveDesmond-ca opened this issue Jul 13, 2022 · 1 comment · Fixed by agrc/kitchen-sink#125 or #10116
Labels
feat: library mode p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) regression The issue only appears after a new release

Comments

@SteveDesmond-ca
Copy link

SteveDesmond-ca commented Jul 13, 2022

Describe the bug

I have a vite config that builds and outputs multiple files in "library mode". (see minimal repro) It works fine in vite v2, but fails in vite v3.

Steps to reproduce:

  1. load reproduction URL
  2. npm i and npm run vite to see successful case in v2
  3. update vite in package.json to 3.0.0
  4. npm i and npm run vite to see failed case in v3

Note I've also tried just putting 1 of the files as the lib.entry, and alternatively creating a "dummy" single file (e.g. blank.ts) as the entry point, while keeping the list of files in rollupOptions.input. It seems the rollupOptions.input is ignored in v3, as it's only building the file in lib.entry.

Reproduction

https://stackblitz.com/edit/vitejs-vite-wspcu8

System Info

Note that this also fails in Linux environments, such as StackBlitz

  System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Memory: 22.45 GB / 31.95 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.49)
  npmPackages:
    vite: 3.0.0 => 3.0.0

Used Package Manager

yarn and/or npm

Logs

vite v2

$ vite build .
vite v2.9.14 building for production...
✓ 2 modules transformed.
dist/file1.cjs.js   0.04 KiB / gzip: 0.06 KiB
dist/file2.cjs.js   0.04 KiB / gzip: 0.06 KiB

vite v3

$ vite build .
vite v3.0.0 building for production...
✓ 0 modules transformed.
Could not resolve entry module (*.ts).
error during build:
Error: Could not resolve entry module (*.ts).
    at error (file:///X:/vite3-repro/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at ModuleLoader.loadEntryModule (file:///X:/vite3-repro/node_modules/rollup/dist/es/shared/rollup.js:22396:20)
    at async Promise.all (index 0)
error Command failed with exit code 1.

Validations

@sapphi-red
Copy link
Member

It seems #7275 is affecting this.

related: #4530, #7047

@sapphi-red sapphi-red added regression The issue only appears after a new release feat: library mode labels Jul 14, 2022
@sapphi-red sapphi-red added p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) and removed pending triage labels Jul 31, 2022
stdavis added a commit to agrc/kitchen-sink that referenced this issue Aug 22, 2022
We will likely be able to upgrade again after this bug is fixed: vitejs/vite#9086
stdavis added a commit to agrc/kitchen-sink that referenced this issue Aug 22, 2022
We will likely be able to upgrade again after this bug is fixed: vitejs/vite#9086
stdavis added a commit to agrc/kitchen-sink that referenced this issue Aug 22, 2022
We will likely be able to upgrade again after this bug is fixed: vitejs/vite#9086
stdavis added a commit to agrc/kitchen-sink that referenced this issue Aug 22, 2022
We will likely be able to upgrade again after this bug is fixed: vitejs/vite#9086
@sapphi-red sapphi-red changed the title Wildcard lib entry no longer supported in v3 build.lib overwrites build.rollupOptions.input in v3 Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: library mode p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) regression The issue only appears after a new release
Projects
None yet
2 participants