Skip to content
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

Compiler throws error when using < in expressions in templates with lang="pug" #1120

Closed
rashfael opened this issue May 4, 2020 · 3 comments

Comments

@rashfael
Copy link

rashfael commented May 4, 2020

Version

3.0.0-beta.8

Reproduction link

https://codesandbox.io/s/focused-wescoff-1echv

Steps to reproduce

  1. Open reproduction

What is expected?

page should render test.

What is actually happening?

The following error appears:

Failed to compile.

./src/App.vue
Module Error (from ./node_modules/vue-loader/dist/index.js):

VueCompilerError: Illegal tag name. Use '&lt;' to print '<'.
at /sandbox/src/App.vue:2:12
1  |  <template lang="pug">
2  |  p(v-if="1 < 2") test
   |             ^
3  |  </template>
4  |  
@mehdi-aouadi
Copy link

I am facing the same issue.
I am migrating a Vue 2 app to Vue 3 following the migration guide.
I am getting the same error when using a logical expression within a v-if tag:
VueCompilerError: Illegal tag name. Use '&lt;' to print '<'.

@rashfael Did you manage to fix this?

@rashfael
Copy link
Author

rashfael commented Nov 3, 2021

d10835a fixed this for me. We're currently running vue@3.2.20 in a project with v-if="…<…" in pug templates. I'd recommend creating a clean reproduction and opening a new issue. My reproduction from this issue is working after updating vue and forking the sandbox to force a clean install https://codesandbox.io/s/friendly-stonebraker-l6jzc.

@mehdi-aouadi
Copy link

Actually I am using vue@3.2.20 with vue/compat@3.2.20 with compatConfig MODE=2 and I am facing the same issue.
I will try to create a reproduction sandbox.
Thanks

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants