amplify-hosting
amplify-hosting copied to clipboard
Support for VikeJS
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting questions.
- [X] I have removed any sensitive information from my code snippets and submission.
App Id
d104w4v8nmd5no
AWS Region
us-east-2
Amplify Hosting feature
SSR
Question
I would like to be able to access my site through the production link provided through Amplify Hosting. I am using Vite with Vite SSR Plugin for frontend tooling.
version: 1
backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- amplifyPush --simple
- # Rename .js file to be properly called
- mv src/aws-exports.js src/aws-exports.ts
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build #(calls vite build)
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: dist/client
files:
- '**/*'
cache:
paths:
- node_modules/**/*
Build Folder Architecture
I also changed my Amplify config to Amplify.configure({ ...awsExports, ssr: true });
I read that Amplify automatically detects when using SSR, how could I configure my application to match this spec?
Currently, when I run a build. It succeeds but my site fails to show content
(@Brillout)
Hi @charlieforward9 👋🏽 thanks for raising this issue. At this time, Amplify Hosting only supports SSR applications that leverage the Next.js framework:
You can use AWS Amplify to deploy and host web apps that use server-side rendering (SSR). Currently, Amplify Hosting supports apps created using the Next.js framework. When you deploy your app, Amplify automatically detects SSR–you do not have to perform any manual configuration in the AWS Management Console.
We can take this as a feature request to support vite-plugin-ssr
in the future.
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
@hloriii Hello, thank you for the response! Amplify team is certainly occupied with other tickets, as I see there are about 600 open issues at the moment. However, I am curious to know a timeline, if you're able to provide one... I would like to be able to report a general projection to my team.
Author of vite-plugin-ssr
here. I appreciate that you're considering adding support for other frameworks other than Next.js — let me know if there is something that can be done on vite-plugin-ssr's side.
Hoping to continue this discussion as I may be running into issues around this. https://github.com/brillout/vite-plugin-ssr/discussions/934
I ran into similar issues in the past when using SSR + Amplify. But recently gave it another shot and got a Vite SSR build working and hosted with amplify-hosting, check it out: https://github.com/bebeal/vite-amplify this leads me to believe Vike should work with it as well
@brillout @ghost my applications specs are making ssr a tempting option right now. Has there any discussion or work into an integration potential?
We've recently added AWS to Bati, but I don't think it uses Amplify. Other than that no news on my side.