-
-
Notifications
You must be signed in to change notification settings - Fork 64
Build failed with URIError #36
Replies: 1 comment · 7 replies
-
The automatic deployment of this project on Netlify works fine, so I'm not quite sure what's going on. maybe I can check it out tomorrow |
Beta Was this translation helpful? Give feedback.
All reactions
-
It's worth noting that I'm using an Arch Linux and node v18.8.0 locally. might that help? |
Beta Was this translation helpful? Give feedback.
All reactions
-
It's a good tip. I'm using node v16.20.0 in Windows right now. I'll try with version 18.18.0. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Now I turn to Ubuntu and build successfully. However, when I try to deploy at github pages, I try to add a config -- path.base in svelte.config.ts, it builds failed again. My svelte.config.ts: // sveltekit config type
import type { Config } from '@sveltejs/kit'
// svelte adapter
import adapterAuto from '@sveltejs/adapter-auto'
import adapterNode from '@sveltejs/adapter-node'
import adapterStatic from '@sveltejs/adapter-static'
// svelte preprocessor
import { mdsvex } from 'mdsvex'
import mdsvexConfig from './mdsvex.config.js'
import preprocess from 'svelte-preprocess'
const defineConfig = (config: Config) => config
export default defineConfig({
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
preprocess: [mdsvex(mdsvexConfig), preprocess()],
kit: {
adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key))
? adapterAuto()
: process.env.ADAPTER === 'node'
? adapterNode({ out: 'docs' })
: adapterStatic({
pages: 'docs',
assets: 'docs',
fallback: undefined
}),
paths: { base: '/urara-blog' }, // my repo name
csp: { mode: 'auto' }
}
}) Error message: ✓ 78 modules transformed.
(!) "base" option should end with a slash.
vite v3.1.0-beta.1 building SSR bundle for production...
✓ 97 modules transformed.
.svelte-kit/output/server/manifest.webmanifest 0.13 KiB
.svelte-kit/output/server/vite-manifest.json 5.08 KiB
.svelte-kit/output/server/index.js 79.66 KiB
.svelte-kit/output/server/entries/endpoints/atom.xml/_server.ts.js 2.14 KiB
.svelte-kit/output/server/entries/endpoints/feed.json/_server.ts.js 1.68 KiB
.svelte-kit/output/server/entries/endpoints/manifest.webmanifest/_server.ts.js 0.90 KiB
.svelte-kit/output/server/entries/endpoints/posts.json/_server.ts.js 0.43 KiB
.svelte-kit/output/server/entries/endpoints/sitemap.xml/_server.ts.js 0.90 KiB
.svelte-kit/output/server/entries/endpoints/tags.json/_server.ts.js 0.45 KiB
.svelte-kit/output/server/entries/pages/_layout.svelte.js 16.95 KiB
.svelte-kit/output/server/entries/pages/_layout.ts.js 0.18 KiB
.svelte-kit/output/server/entries/pages/_error.svelte.js 1.75 KiB
.svelte-kit/output/server/entries/pages/_page.svelte.js 5.51 KiB
.svelte-kit/output/server/entries/pages/hello-world/_page.svelte.md.js 0.26 KiB
.svelte-kit/output/server/entries/pages/hello-world/elements/_page.svelte.md.js 0.28 KiB
.svelte-kit/output/server/entries/pages/hello-world/toc-disabled/_page.md.js 0.28 KiB
.svelte-kit/output/server/chunks/index.js 3.82 KiB
.svelte-kit/output/server/chunks/index2.js 1.29 KiB
.svelte-kit/output/server/chunks/site.js 0.52 KiB
.svelte-kit/output/server/chunks/footer.js 9.37 KiB
.svelte-kit/output/server/chunks/icon.js 0.83 KiB
.svelte-kit/output/server/chunks/posts.js 29.68 KiB
.svelte-kit/output/server/chunks/post_card.js 9.17 KiB
.svelte-kit/output/server/chunks/title.js 0.18 KiB
.svelte-kit/output/server/chunks/stores.js 1.00 KiB
.svelte-kit/output/server/chunks/hooks.js 0.23 KiB
SyntaxError: Unexpected token N in JSON at position 0
at JSON.parse (<anonymous>)
at Proxy.<anonymous> (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1704:25)
at async load (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/entries/pages/_layout.ts.js:4:8)
at async load_data (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1364:16)
at async file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1918:18
SyntaxError: Unexpected token N in JSON at position 0
at JSON.parse (<anonymous>)
at Proxy.<anonymous> (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1704:25)
at async load (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/entries/pages/_layout.ts.js:4:8)
at async load_data (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1364:16)
at async file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1918:18
SyntaxError: Unexpected token N in JSON at position 0
at JSON.parse (<anonymous>)
at Proxy.<anonymous> (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1704:25)
at async load (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/entries/pages/_layout.ts.js:4:8)
at async load_data (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1364:16)
at async file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1918:18
SyntaxError: Unexpected token N in JSON at position 0
at JSON.parse (<anonymous>)
at Proxy.<anonymous> (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1704:25)
at async load (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/entries/pages/_layout.ts.js:4:8)
at async load_data (file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1364:16)
at async file:///home/robin/projects/urara-blog/urara-blog/.svelte-kit/output/server/index.js:1918:18
file:///home/robin/projects/urara-blog/urara-blog/node_modules/.pnpm/@[email protected]_fhgkwirxvgjw2igda6zmhiisma/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:50
throw new Error(format_error(details, config));
^
Error: 500 /urara-blog/hello-world
at file:///home/robin/projects/urara-blog/urara-blog/node_modules/.pnpm/@[email protected]_fhgkwirxvgjw2igda6zmhiisma/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:50:11
at save (file:///home/robin/projects/urara-blog/urara-blog/node_modules/.pnpm/@[email protected]_fhgkwirxvgjw2igda6zmhiisma/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:355:4)
at visit (file:///home/robin/projects/urara-blog/urara-blog/node_modules/.pnpm/@[email protected]_fhgkwirxvgjw2igda6zmhiisma/node_modules/@sveltejs/kit/src/core/prerender/prerender.js:232:3)
Node.js v18.8.0
[vite-plugin-svelte-kit] Prerendering failed with code 1
PWA v0.12.4
mode generateSW
precache 26 entries (321.45 KiB)
files generated
.svelte-kit/output/client/sw.js
.svelte-kit/output/client/workbox-ab24e45d.js
error during build:
Error: Prerendering failed with code 1
at ChildProcess.<anonymous> (file:///home/robin/projects/urara-blog/urara-blog/node_modules/.pnpm/@[email protected]_fhgkwirxvgjw2igda6zmhiisma/node_modules/@sveltejs/kit/src/exports/vite/index.js:435:15)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
ELIFECYCLE Command failed with exit code 1.
ERROR: "kit:build" exited with 1.
ELIFECYCLE Command failed with exit code 1. |
Beta Was this translation helpful? Give feedback.
All reactions
-
It is worth noting that Urara is not adapted for SvelteKit's subdirectory feature, which means it cannot be deployed under directories. |
Beta Was this translation helpful? Give feedback.
All reactions
-
For GitHub Pages, see my build script here so that it will automatically build when a new commit is available. (need to be adjusted for Urara) |
Beta Was this translation helpful? Give feedback.
-
hello,
I try to build the project, but failed by a URIError. I haven't made any changes to the project, so I'm wondering what causes this problem.
Here is my project: https://github.com/r0bin-zheng/urara-blog
Beta Was this translation helpful? Give feedback.
All reactions