Skip to content

Bug: type errors while using SFC script setup #1232

@Oleksii14

Description

@Oleksii14

Describe the bug
While using two top-level script blocks in SFC, there appear TS errors in the console after vite build that go from @vue/test-utils typings. Those errors depend on the trailing coma from the first script block.

To Reproduce
Reproduction repo
Steps:

pnpm i
pnpm run test:unit # test will pass
pnpm run build # will fail, see the type errors

Then go to HelloWorld.vue and remove a trailing comma in line 4.
Perform the steps above and the build error will dissapear.

Expected behavior
Type errors do not appear and do not depend on the trailing comma in the top-level script

Related information:

  • @vue/test-utils version: 2.0.0-rc.18
  • Vue version: 3.2.26
  • node version: 14.17.6
  • pnpm version: 6.25.1

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions