Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vercel Adapter Error. #260

Closed
bencipher opened this issue Sep 11, 2023 · 4 comments
Closed

Vercel Adapter Error. #260

bencipher opened this issue Sep 11, 2023 · 4 comments

Comments

@bencipher
Copy link

I get error whenever i tried to use vercel adapter.

Steps to replicate:
Clone the main astrowind branch, then install additional dependency of vercel. Then deploy using vercel CLI.
Modify astro.config.mjs as follows:
import vercel from "@astrojs/vercel/serverless";
export default defineConfig({
output: 'server',
adapter: vercel()
})

#CLI
`challengers_deep > npm i @astrojs/vercel

added 43 packages, and audited 839 packages in 11s

319 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
challengers_deep > vercel
Vercel CLI 31.2.3
🔍 Inspect: https://vercel.com/bencipher/astrowind/G1AaEkanE5pjYqrCXf5zerCzjaLP [2s]
✅ Preview: https://astrowind-bencipher.vercel.app [29s]
📝 To deploy to production (astrowind-delta.vercel.app), run `vercel --prod``

image
image

Vercel Logs:
Error: ENOENT: no such file or directory, open 'src/config.yaml'
at Object.openSync (node:fs:603:3)
at Object.readFileSync (node:fs:471:35)
at file:///var/task/vercel/path0/dist/chunks/pages/404_0e0c8443.mjs:296:29
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'src/config.yaml'
}
RequestId: ffbb4a90-01e7-491a-a68f-40c58dd56cad Error: Runtime exited with error: exit status 1
Runtime.ExitError

@prototypa
Copy link
Contributor

Hi @bencipher

For now AstroWind only works with "static" output and for some adapters with "hybrid" output.

Also the introduction of the config.yaml file (from a simple config.json) caused a code (to convert from yaml to json) that we have to fix, which you mention in your issue. That doesn't affect the static output but it does close the door for a deep revision of AstroWind to make it SSR. At this time, in addition to that error, the reason why it is not SSR is because of how the blog is developed. The blog uses getStaticPaths() which is only for static output and some intelligent configuration would have to be done so that it could also be coded for SSR without too many complications. I already have an idea in mind but I haven't had time to code it.

I'll keep you up to date with any changes. I will also mention you when I solve the problem with the config.yaml.

Anyway, quick answer, for now AstroWind does not work in SSR with Vercel, only static output.

@bencipher
Copy link
Author

bencipher commented Sep 20, 2023 via email

@prototypa
Copy link
Contributor

@bencipher

ABOUT icons:

Maybe what you mention about icons is related to this: natemoo-re/astro-icon#111 (comment)

In that case, instead of "*" you should put in the astro.config.mjs the exact list of icon names that you are using, as they say there.

ABOUT config.yaml:

A simple solution would be to manually transform the src/config.yaml to src/config.json and in src/utils/config.js, instead of that conversion that exists there with 'fs' and json- yaml, simply import the config.json.

I've wanted to work on that but I haven't had much time these days.

@bencipher
Copy link
Author

bencipher commented Sep 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants