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

Error when using "vite-ignore" attribute in <script type="module"> tag #19055

Open
7 tasks done
oscarmarina opened this issue Dec 23, 2024 · 0 comments · May be fixed by #19062
Open
7 tasks done

Error when using "vite-ignore" attribute in <script type="module"> tag #19055

oscarmarina opened this issue Dec 23, 2024 · 0 comments · May be fixed by #19062
Labels
feat: html p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@oscarmarina
Copy link

Describe the bug

When I use the vite-ignore attribute in a <script type="module"> tag like this:
<script vite-ignore type="module">

I get the following error:

  • [vite] Internal server error: Cannot read properties of undefined (reading 'attrs')

It seems that Vite does not support the vite-ignore attribute and fails to parse it. Is there any way to ignore certain <script type="module"> tags during the development process?

Reproduction

https://stackblitz.com/edit/vitejs-vite-rbkwyxun?file=src%2Fmy-element.js

Steps to reproduce

Screenshot 2024-12-23 at 23 59 01

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M3
    Memory: 84.69 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.2.0 - ~/.nvm/versions/node/v23.2.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v23.2.0/bin/yarn
    npm: 11.0.0 - ~/.nvm/versions/node/v23.2.0/bin/npm
    bun: 1.1.34 - ~/.bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.205
    Chrome Canary: 133.0.6913.0
    Edge: 131.0.2903.112
    Safari: 18.2
    Safari Technology Preview: 18.2

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added feat: html p3-minor-bug An edge case that only affects very specific usage (priority) labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: html p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants