Skip to content

Error when pug directive expression contains < #11

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

Closed
caikan opened this issue Mar 15, 2022 · 3 comments
Closed

Error when pug directive expression contains < #11

caikan opened this issue Mar 15, 2022 · 3 comments

Comments

@caikan
Copy link

caikan commented Mar 15, 2022

Environment


  • Operating System: Linux
  • Node Version: v16.12.0
  • Nuxt Version: 2.16.0-27358576.777a4b7f
  • Package Manager: [email protected]
  • Builder: webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/s/pug-prop-b66qtr?file=/pages/index.vue

Describe the bug

When SFC has a <script setup> block, directive expression containing a less than operator < in pug syntax causes error:

<script setup>
</script>
<template lang="pug">
div(v-if="1 < 2")
  | hello
</template>
 ERROR  Failed to compile with 1 errors               friendly-errors 16:32:11


 ERROR  in ./pages/index.vue                          friendly-errors 16:32:11

Module Error (from ./node_modules/@nuxt/bridge/node_modules/unplugin-vue2-script-setup/node_modules/unplugin/dist/webpack/loaders/transform.js):
Illegal tag name. Use '&lt;' to print '<'.
                                                      friendly-errors 16:32:11
 @ ./.nuxt/router.js 27:24-29:3
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/bridge/dist/runtime/capi.plugin.mjs ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

cc: @antfu

@antfu
Copy link
Member

antfu commented Mar 16, 2022

Upstream: unplugin/unplugin-vue2-script-setup#124

@danielroe danielroe transferred this issue from nuxt/framework Apr 13, 2022
@danielroe
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants