Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Astro, seeing `X [ERROR] The build was canceled` in build output (npm run build)

$
0
0

I'm seeing the following the following error in the console logs on npm run build ("build": "astro check && astro build"). The build actually completes following this, but I don't like not understanding what's goin on here.

I have included the standard Astro blog template files and the Svelete integration.

I have narrowed the issue down to some sort of conflict between the Svelte integration and the content/config.ts file for the blog, because when I take Svelte references out from astro.config.mjs out, rollback to a version before the inclusion of blog files or move the content/config.ts file, the X [ERROR] The build was canceled line goes away.

What's causing this?

I have included the content below of what I think are the relevant files.

astro.config.mjs

import { defineConfig } from 'astro/config';import svelte from '@astrojs/svelte';import mdx from '@astrojs/mdx';import sitemap from '@astrojs/sitemap';import tailwind from '@astrojs/tailwind';// https://astro.build/configexport default defineConfig({    site: 'https://example.com',    integrations: [svelte(), tailwind(), mdx(), sitemap()],});

svelte.config.js

import { vitePreprocess } from '@astrojs/svelte';export default {    preprocess: vitePreprocess(),};

config/blog/config.ts

import { defineCollection, z } from 'astro:content';const blog = defineCollection({    // Type-check frontmatter using a schema    schema: z.object({        title: z.string(),        description: z.string(),        // Transform string to Date object        pubDate: z.coerce.date(),        updatedDate: z.coerce.date().optional(),        heroImage: z.string().optional(),    }),});export const collections = { blog };

Viewing all articles
Browse latest Browse all 1541

Trending Articles