Assistance Required: Firestore Service Not Available During Deployment with Vite and GitHub Actions #324
Unanswered
shanulhabib
asked this question in
Q&A
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hi,
I am currently facing an issue while deploying my Vite-based React application to AWS using GitHub Actions. The deployment process completes successfully, but when I try to run the application, I encounter the following error in the browser console: "Uncaught Error: Service firestore is not available".
I am using this vite.config.ts
`import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import viteTsconfigPaths from 'vite-tsconfig-paths'
import commonjs from '@rollup/plugin-commonjs';
export default defineConfig({
// depending on your application, base can also be "/"
base: '',
resolve: {
alias: {
'aws-sdk': 'aws-sdk/dist/aws-sdk.min.js',
},
},
define: {
global: 'globalThis',
},
plugins: [react(), viteTsconfigPaths(), updateCommonjsPlugin()],
server: {
// this ensures that the browser opens upon server start
open: true,
// this sets a default port to 3000
port: 3000,
watch: {
followSymlinks: false,
},
},
build: {
minify: false,
sourcemap: false,
},
})
function updateCommonjsPlugin(): import('vite').PluginOption {
const commonJs22 = commonjs({
include: [/node_modules/],
extensions: ['.js', '.cjs'],
strictRequires: true,
})
return {
name: 'new-common-js',
apply: 'build',
config: (config) => {
return {
...config,
plugins: [...(config.plugins || []), commonJs22],
}
},
}
}`
Need help and thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions