The Wayback Machine - https://web.archive.org/web/20250522190127/https://github.com/vuejs/vue/issues/11612
Skip to content

TemplateRender.renderScripts breaks when there are no preloaded files (empty array) #11612

Closed
@john-ko

Description

@john-ko

Version

2.6.11

Reproduction link

https://github.com/john-ko/vue/commit/f955d9e96ef35fa8609c126501ac0d7f90ee9bc4

Steps to reproduce

the client manifest must have its inital array empty

What is expected?

not to crash due to empty array

What is actually happening?

in src/server/template-renderer/index.js line 227~

const needed = [initial[0]].concat(async, initial.slice(1))
given initial as empty array needed becomes

[ undefined, {...}, {...}]

when it destructures { file } which is transpiled down to
ref.file it fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions