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

@vitejs/plugin-legacy rollupOptions.output.entryFileNames and rollupOptions.output.chunkFileNames does not support the function format. #3636

Closed
6 tasks done
wxxcarl opened this issue Jun 2, 2021 · 2 comments · Fixed by #4122

Comments

@wxxcarl
Copy link

wxxcarl commented Jun 2, 2021

Describe the bug

i meet this error:
Error: @vitejs/plugin-legacy rollupOptions.output.entryFileNames and rollupOptions.output.chunkFileNames does not support the function format.
when i update my dependence '@vitejs/plugin-legacy' from '1.4.0' to '1.4.1'

Reproduction

my config:

plugins: [
    legacy()
   ...
],
build: {
    rollupOptions: {
      output: {
         chunkFileNames: ChunkInfo => {
           //do something with ChunkInfo
          return 'assets/'+myName+'.[hash].js'
      }
    }
  }
}

System Info

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

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 1.71 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.6 - /usr/local/bin/npm
  Browsers:
    Chrome: 90.0.4430.212
    Safari: 14.0.3
  npmPackages:
    vite: ^2.3.3 => 2.3.5 

Used package manager:
@vitejs/plugin-legacy: 1.4.1

Logs

error during build:
Error: @vitejs/plugin-legacy rollupOptions.output.entryFileNames and rollupOptions.output.chunkFileNames does not support the function format.
    at getLegacyOutputFileName (/Users/sy/work/syao/activity-front/node_modules/@vitejs/plugin-legacy/index.js:182:17)
    at createLegacyOutput (/Users/sy/work/syao/activity-front/node_modules/@vitejs/plugin-legacy/index.js:206:27)
    at Object.configResolved (/Users/sy/work/syao/activity-front/node_modules/@vitejs/plugin-legacy/index.js:215:33)
    at /Users/sy/work/syao/activity-front/node_modules/vite/dist/node/chunks/dep-01eec7aa.js:70545:127
    at Array.map (<anonymous>)
    at resolveConfig (/Users/sy/work/syao/activity-front/node_modules/vite/dist/node/chunks/dep-01eec7aa.js:70545:35)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async doBuild (/Users/sy/work/syao/activity-front/node_modules/vite/dist/node/chunks/dep-01eec7aa.js:45228:20)
    at async build (/Users/sy/work/syao/activity-front/node_modules/vite/dist/node/chunks/dep-01eec7aa.js:45216:16)
    at async CAC.<anonymous> (/Users/sy/work/syao/activity-front/node_modules/vite/dist/node/cli.js:13928:9)
npm ERR! code ELIFECYCLE

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

@khalwat
Copy link
Contributor

khalwat commented Jun 4, 2021

I'm seeing this as well, when attempting to use plugin-legacy 1.4.1 with VitePress

@khalwat
Copy link
Contributor

khalwat commented Jul 11, 2021

Closes vuejs/vitepress#309

Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 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.

2 participants