Skip to content

<script setup lang="ts"> blocks don't compile when they contain Typescript angle bracket syntax #6736

Open
@Michrock

Description

@Michrock

Version

5.0.0-beta.4

Reproduction link

github.com

Environment info


Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
  Binaries:
    Node: 12.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 94.0.4606.81
    Edge: Spartan (44.19041.1023.0), Chromium (94.0.992.38)
  npmPackages:
    @vue/cli-overlay:  5.0.0-beta.4 
    @vue/cli-plugin-router:  5.0.0-beta.4 
    @vue/cli-plugin-typescript: ~5.0.0-beta.4 => 5.0.0-beta.4 
    @vue/cli-plugin-vuex:  5.0.0-beta.4 
    @vue/cli-service: ~5.0.0-beta.4 => 5.0.0-beta.4 
    @vue/cli-shared-utils:  5.0.0-beta.4 
    @vue/compiler-core:  3.2.20 
    @vue/compiler-dom:  3.2.20 
    @vue/compiler-sfc: ^3.2.6 => 3.2.20 
    @vue/compiler-ssr:  3.2.20 
    @vue/component-compiler-utils:  3.2.2 
    @vue/reactivity:  3.2.20 
    @vue/ref-transform:  3.2.20 
    @vue/runtime-core:  3.2.20 
    @vue/runtime-dom:  3.2.20 
    @vue/server-renderer:  3.2.20 
    @vue/shared:  3.2.20 
    @vue/web-component-wrapper:  1.3.0 
    typescript: ~4.1.5 => 4.1.6 
    vue: ^3.2.6 => 3.2.20 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  16.8.1 (15.9.8)
    vue-style-loader:  4.1.3 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: Not Found


Steps to reproduce

Attempt to serve or build the repo using 'npm run serve' or 'npm run build'.

To remove the breaking change, simply remove the angle bracket type assertion syntax used on the test variable.

What is expected?

Project should compile without issue

What is actually happening?

Project fails compilation with the following error:

'Syntax Error: TypeError: Cannot read property 'content' of null'


Same issue is encountered on MacOS and is the same with or without Babel.

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