【问题标题】:error: [astro preview] adapter does not have previewentrypoint错误:[astro 预览] 适配器没有预览入口点
【发布时间】:2022-11-11 00:25:31
【问题描述】:

我一直在用 astro (https://astro.build) 创建一个网站,一段时间后,在运行 astro preview 时出现错误。这是我的astro.config.mjs 代码:

import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
import serviceWorker from 'astrojs-service-worker';

export default defineConfig({
    trailingSlash: 'ignore',
    output: 'server',
    adapter: vercel(),
    integrations: [serviceWorker()],
});

任何帮助,将不胜感激。

【问题讨论】:

    标签: javascript html web preview astro


    【解决方案1】:

    您无法使用astro preview 预览 SSR 适配器的构建,节点适配器除外。

    我引用docs

    从 Astro 1.5.0 开始,如果您使用支持它的适配器,astro 预览版也适用于 SSR 构建。目前,只有 Node 适配器支持 astro 预览。

    【讨论】:

      猜你喜欢
      • 2018-08-17
      • 2021-09-15
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 2021-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多