Svelte with snowpack 在尝试导入过渡时给出“未实现:动画”

问题描述

通常,我可以像这样以苗条的方式导入 flip 或其他动画:

import { flip } from "svelte/animate";

但是,我不确定为什么在使用 svelte 的 snowpack 中出现以下错误:

Build Error: @snowpack/plugin-svelte
Error: Not implemented: Animation

Source
/Users/duane/Braid/ribbon/client/src/Posts/PostsPage.svelte
Error: Not implemented: Animation
    at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27126:28
    at Array.forEach (<anonymous>)
    at new InlineComponent$1 (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27087:26)
    at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27358:23
    at Array.map (<anonymous>)
    at map_children (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27353:22)
    at new IfBlock$1 (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27063:26)
    at /Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27358:23
    at Array.map (<anonymous>)
    at map_children (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27353:22)
    at new Fragment (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27410:26)
    at new Component (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:27547:26)
    at Object.compile (/Users/duane/Braid/ribbon/node_modules/svelte/compiler.js:28753:24)
    at Object.load (/Users/duane/Braid/ribbon/node_modules/@snowpack/plugin-svelte/plugin.js:120:31)
    at async runPipelineLoadStep (/Users/duane/Braid/ribbon/node_modules/snowpack/lib/index.js:74471:28)
    at async Object.buildFile (/Users/duane/Braid/ribbon/node_modules/snowpack/lib/index.js:74638:24)

我错过了什么吗?

解决方法

事实证明这与积雪无关。

相反,当您尝试在组件(例如 <MySpecialButton />)上添加“animate:flip”或“transition:slide”(例如)时,会出现“未实现:动画”错误。 animate:transition: 属性只能用于 <div /> 等 DOM 元素。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...