Skip to content

css.js throw Cannot read properties of null (reading 'querySelector') #17960

@pengpengmz

Description

@pengpengmz

Describe the bug

`my component as below:
....

<style> .el-button--primary.is-text { color: var(--el-button-text-color); } </style>

In some cases throw Cannot read properties of null (reading 'querySelector')

src\internal\client\dom\css.js
export function append_styles(anchor, css) {
line 21: if (!target.querySelector('#' + css.hash)) {
//add target&&
if (target&&!target.querySelector('#' + css.hash)) {`

Reproduction

Uncaught TypeError: Cannot read properties of null (reading 'querySelector')

in <unknown>
in Button.svelte
in Popper.svelte
in App.svelte
in Router.svelte
in Col.svelte
in Row.svelte
in App.svelte
in undefined

Logs

System Info

svelte, webpack --binaries

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting submitterneeds a reproduction, or clarificationcssStuff related to Svelte's built-in CSS handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions