Skip to content

fix: importing unscoped style between multiple sfc's #612

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Kolobok12309
Copy link
Contributor

Description

Sometimes when you import same css (not scoped) file between multiple sfc's you get error while build #5977, #8660

[vite:vue] Cannot read properties of undefined (reading 'scoped')

It not very stable error, in out project we only get it in docker, but all be fine on local machine

Reproduce repo from my local machine

Additional context

Multiple descriptors try attach to same filename and style tag can has another index. I fix index to first descriptor and don't reassign it. But finding of index is not so good code


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

pkg-pr-new bot commented Jun 26, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/plugin-vue@612
npm i https://pkg.pr.new/@vitejs/plugin-vue-jsx@612

commit: 26afe8f

@Kolobok12309 Kolobok12309 changed the title fix: Can import style between multiple sfc's fix: importing unscoped style between multiple sfc's Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant