config.kit.adapter 应该是一个带有“adapt"的对象.方法 [英] config.kit.adapter should be an object with an "adapt" method

查看:18
本文介绍了config.kit.adapter 应该是一个带有“adapt"的对象.方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 Svelte Kit 应用程序中使用 @sveltejs/adapter-static(想把它变成一个 SPA).我使用 npm i @sveltejs/adapter-static 安装了静态适配器.

I want to use the @sveltejs/adapter-static in my Svelte Kit app (want to turn it into an SPA). I installed the adapter static with npm i @sveltejs/adapter-static.

svelte.config.cjs 中的代码是这样的

The code in the svelte.config.cjs looks like this

kit: {
    // By default, `npm run build` will create a standard Node app.
    // You can create optimized builds for different platforms by
    // specifying a different adapter
    adapter: adapter({
        fallback: 'app.html'
    }),

当我使用 npm run dev 启动我的应用程序时,我收到以下错误:config.kit.adapter 应该是一个带有adapt"的对象.方法

When I start my app with npm run dev I get the following error: config.kit.adapter should be an object with an "adapt" method

我该如何解决这个问题?

How can I fix this?

推荐答案

只需使用以下命令安装即可:

just install it with the following command:

npm i -D @sveltejs/adapter-static@next

感谢:https://github.com/GrygrFlzr

这篇关于config.kit.adapter 应该是一个带有“adapt"的对象.方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆