Skip to content

Error Invalid end tag when you put a string "</script>" inside the script tag even if it's just a comment line #15624

@heart

Description

@heart

Environment


  • Operating System: Darwin
  • Node Version: v16.18.0
  • Nuxt Version: 3.0.0
  • Nitro Version: 1.0.0
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: typescript, runtimeConfig, app, modules, formkit, hooks
  • Runtime Modules: @formkit/[email protected]
  • Build Modules: -

Reproduction

Create pages/index.vue

put the content as

<template><div></div></template>
<script lang="ts" setup>
//</script> This is just a comment
</script> 

or

<template><div></div></template>
<script lang="ts" setup>
const myVar = "</script>";
</script> 

then run yarn dev

Describe the bug

Error Invalid end tag when you put a string "</script>"
inside the script tag even if it's just a comment line

Additional context

No response

Logs

[vite-node] [plugin:vite:vue] [SyntaxError] ./pages/.....vue:48:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions