### 动画重复 ``` An element can only have one 'animate' directive ``` ### 动画无效位置 ``` An element that uses the `animate:` directive must be the only child of a keyed `{#each ...}` block ``` ### 动画缺失键 ``` An element that uses the `animate:` directive must be the only child of a keyed `{#each ...}` block. Did you forget to add a key to your each block? ``` ### 属性\_contenteditable\_动态 ``` 'contenteditable' attribute cannot be dynamic if element uses two-way binding ``` ### 属性\_contenteditable\_missing ``` 'contenteditable' attribute is required for textContent, innerHTML and innerText two-way bindings ``` ### 属性重复 `属性需要唯一` ### 属性\_空简写 ``` Attribute shorthand cannot be empty ``` ### 属性无效事件处理器 ``` Event attribute must be a JavaScript expression, not a string ``` ### 属性无效多次 ``` 'multiple' attribute must be static if select uses two-way binding ``` ### 属性无效名称 ``` '%name%' is not a valid attribute name ``` ### 属性无效的序列表达式 ``` Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses ``` ### 属性无效类型 ``` 'type' attribute must be a static text value if input uses two-way binding ``` ### 属性未引号序列 ``` Attribute values containing `{...}` must be enclosed in quote marks, unless the value only contains the expression ``` ### 绑定组无效表达式 ``` `bind:group` can only bind to an Identifier or MemberExpression ``` ### 绑定组无效的片段参数 ``` Cannot `bind:group` to a snippet parameter ``` ### 绑定无效表达式 ``` Can only bind to an Identifier or MemberExpression or a `{get, set}` pair ``` ### 绑定无效名称 ``` `bind:%name%` is not a valid binding ``` ``` `bind:%name%` is not a valid binding. %explanation% ``` ### 绑定无效括号 ``` `bind:%name%={get, set}` must not have surrounding parentheses ``` ### 绑定无效目标 ``` `bind:%name%` can only be used with %elements% ``` ### 绑定无效值 ``` Can only bind to state or props ``` ### 可绑定无效位置 ``` `$bindable()` can only be used inside a `$props()` declaration ``` ### block\_duplicate\_clause ``` %name% cannot appear more than once within a block ``` ### block\_invalid\_continuation\_placement 阻止无效的延续放置 ``` {:...} block is invalid at this position (did you forget to close the preceding element or block?) ``` ### block\_invalid\_elseif `'elseif' 应该是 'else if'` ### 无效放置 ``` {#%name% ...} block cannot be %location% ``` ### block\_unclosed `块被留下打开` ### block\_unexpected\_character ``` Expected a `%character%` character immediately following the opening bracket ``` ### block\_unexpected\_close `未预期的块关闭标签` ### 组件无效指令 ``` This type of directive is not valid on components ``` ### const\_tag\_cycle ``` Cyclical dependency detected: %cycle% ``` ### const\_tag\_invalid\_expression ``` {@const ...} must consist of a single variable declaration ``` ### const\_tag\_invalid\_placement ``` `{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, ``, `` ``` ### 常量赋值 `无法分配给%thing%` ### 常量绑定 `无法绑定到%thing%` ### css 空声明 `声明不能为空` ### css\_expected\_identifier ``` Expected a valid CSS identifier ``` ### css 全局块无效组合器 ``` A `:global` selector cannot follow a `%name%` combinator ``` ### css 全局块无效声明 ``` A top-level `:global {...}` block can only contain rules, not declarations ``` ### css 全局块无效列表 ``` A `:global` selector cannot be part of a selector list with entries that don't contain `:global` ``` 以下 CSS 无效: ```css :global, x { y { color: red; } } ``` 这是混合了一个`:global`块,这意味着“这里面的所有内容都是未限定的”,与一个限定的选择器(在这种情况下为`x`)。因此,无法将内部选择器(在这种情况下为`y`)转换为满足这两个要求的东西。因此,您必须将其拆分为两个选择器: ```css :global { y { color: red; } } x y { color: red; } ``` ### css 全局块无效修饰符 ``` A `:global` selector cannot modify an existing selector ``` ### css 全局块无效修饰符开始 ``` A `:global` selector can only be modified if it is a descendant of other selectors ``` ### css 全局块无效定位 ``` A `:global` selector cannot be inside a pseudoclass ``` ### css 全局无效位置 ``` `:global(...)` can be at the start or end of a selector sequence, but not in the middle ``` ### css 全局无效选择器 ``` `:global(...)` must contain exactly one selector ``` ### css 全局无效选择器列表 ``` `:global(...)` must not contain type or universal selectors when used in a compound selector ``` ### css 嵌套选择器无效位置 ``` Nesting selectors can only be used inside a rule or as the first selector inside a lone `:global(...)` ``` ### css\_selector\_invalid `无效选择器` ### css\_type\_selector\_invalid\_placement ``` `:global(...)` must not be followed by a type selector ``` ### debug\_tag\_invalid\_arguments ``` {@debug ...} arguments must be identifiers, not arbitrary expressions ``` ### 声明重复 ``` `%name%` has already been declared ``` ### 声明重复模块导入 ``` Cannot declare a variable with the same name as an import inside ` {#each array as entry} {/each} ``` 这结果出现了 bug 和不稳定,尤其是在处理派生值(例如 `array.map(...)`)时,因此在 runes 模式下被禁止。您可以通过使用索引来达到相同的效果: ```svelte {#each array as entry, i} {/each} ``` ### 无效位置 ``` `$effect()` can only be used as an expression statement ``` ### 元素无效的闭合标签 ``` `` attempted to close an element that was not open ``` ### 元素无效关闭标签自动闭合 ``` `` attempted to close element that was already automatically closed by `<%reason%>` (cannot nest `<%reason%>` inside `<%name%>`) ``` ### 元素未闭合 `` `<%name%>` 未关闭 `` ### 事件处理程序无效组件修改器 ``` Event modifiers other than 'once' can only be used on DOM elements ``` ### 事件处理程序无效修饰符 ``` Valid event modifiers are %list% ``` ### 事件处理程序无效的修饰符组合 ``` The '%modifier1%' and '%modifier2%' modifiers cannot be used together ``` ### 预期属性值 `期望的属性值` ### 预期块类型 ``` Expected 'if', 'each', 'await', 'key' or 'snippet' ``` ### expected\_identifier `期望一个标识符` ### expected\_pattern ``` Expected identifier or destructure pattern ``` ### expected\_token `期望的标记 %token%` ### expected\_whitespace `期望的空白` ### 实验异步 ``` Cannot use `await` in deriveds and template expressions, or at the top level of a component, unless the `experimental.async` compiler option is `true` ``` ### 导出未定义 `` `%name%` 未定义 `` ### 全局引用无效 ``` `%name%` is an illegal variable name. To reference a global variable called `%name%`, use `globalThis.%name%` ``` ### 主机无效位置 ``` `$host()` can only be used inside custom element component instances ``` ### 非法元素属性 ``` `<%name%>` does not support non-event attributes or spread attributes ``` ### 导入\_svelte 内部禁止 ``` Imports of `svelte/internal/*` are forbidden. It contains private runtime code which is subject to change without notice. If you're importing from `svelte/internal/*` to work around a limitation of Svelte, please open an issue at https://github.com/sveltejs/svelte and explain your use case ``` ### 检查迹生成器 ``` `$inspect.trace(...)` cannot be used inside a generator function ``` ### 检查无效放置 ``` `$inspect.trace(...)` must be the first statement of a function body ``` ### 无效参数使用 ``` The arguments keyword cannot be used within the template or at the top level of a component ``` ### JavaScript 解析错误 `%message%` ### 遗产\_await\_invalid ``` Cannot use `await` in deriveds and template expressions, or at the top level of a component, unless in runes mode ``` ### 遗产导出无效 ``` Cannot use `export let` in runes mode — use `$props()` instead ``` ### 遗产属性无效 ``` Cannot use `$$props` in runes mode ``` ### 遗产式响应式语句无效 ``` `$:` is not allowed in runes mode, use `$derived` or `$effect` instead ``` ### 遗产\_rest\_props\_invalid ``` Cannot use `$$restProps` in runes mode ``` ### let\_directive\_invalid\_placement ``` `let:` directive at invalid position ``` ### 混合事件处理器语法 ``` Mixing old (on:%name%) and new syntaxes for event handling is not allowed. Use only the on%name% syntax ``` ### 模块\_非法默认导出 ``` A component cannot have a default export ``` ### 节点无效放置 ``` %message%. The browser will 'repair' the HTML (by moving, removing, or inserting elements) which breaks Svelte's assumptions about the structure of your components. ``` HTML 限制某些元素出现的位置。如果发生违规,浏览器将以破坏 Svelte 对您组件结构假设的方式“修复”HTML。一些例子: * `

hello

world

` 将导致 `

hello

world

` (由于 `
` 自动关闭了 `

`,因为 `

` 不能包含块级元素) * `

option a
` 将生成 ``(移除了 `
`) * `
cell
` 将导致 `
cell
` (自动插入 ``) ### 选项无效值 ``` Invalid compiler option: %details% ``` ### options\_removed ``` Invalid compiler option: %details% ``` ### 选项未识别 ``` Unrecognised compiler option %keypath% ``` ### props\_duplicate ``` Cannot use `%rune%()` more than once ``` ### props\_id\_invalid\_placement ``` `$props.id()` can only be used at the top level of components as a variable declaration initializer ``` ### props\_illegal\_name ``` Declaring or accessing a prop starting with `$$` is illegal (they are reserved for Svelte internals) ``` ### props\_invalid\_identifier ``` `$props()` can only be used with an object destructuring pattern ``` ### props\_invalid\_pattern ``` `$props()` assignment must not contain nested properties or computed keys ``` ### props\_invalid\_placement ``` `$props()` can only be used at the top level of components as a variable declaration initializer ``` ### 反应声明周期 ``` Cyclical dependency detected: %cycle% ``` ### 渲染标签无效调用表达式 ``` Calling a snippet function using apply, bind or call is not allowed ``` ### 渲染标签无效表达式 ``` `{@render ...}` tags can only contain call expressions ``` ### 渲染标签无效的传播参数 ``` cannot use spread arguments in `{@render ...}` tags ``` ### 无效的 rune 参数 ``` `%rune%` cannot be called with arguments ``` ### 无效的 rune 参数长度 ``` `%rune%` must be called with %args% ``` ### 无效的运行时计算属性 ``` Cannot access a computed property of a rune ``` ### 无效的 rune 名称 `` `%name%` 不是一个有效的符文 `` ### 无效的符文扩散 ``` `%rune%` cannot be called with a spread argument ``` ### 无效的 rune 使用 ``` Cannot use `%rune%` rune in non-runes mode ``` ### rune\_missing\_parentheses ``` Cannot use rune without parentheses ``` ### rune\_removed ``` The `%name%` rune has been removed ``` ### rune\_renamed ``` `%name%` is now `%replacement%` ``` ### runes\_mode\_invalid\_import ``` %name% cannot be used in runes mode ``` ### 脚本重复 ``` A component can have a single top-level ` {#snippet greeting(name)}

{message} {name}!

{/snippet} ``` ...因为`greeting`引用了`message`,后者定义在第二个`