You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
"aws-sdk": "^2.1482.0",
"vue": "^3.3.7",
"vite": "^4.5.0",
"vite-plugin-pwa": "^0.16.5",
vite.config.ts
export default ({ mode }) => defineConfig({
build: {
chunkSizeWarningLimit: 3000
},
optimizeDeps: {
esbuildOptions: {
target: "es2020",
supported: { bigint: true }
}
},
plugins: [
vue(),
vueJsx(),
VitePWA({})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
})
import AWS from 'aws-sdk'
const sIdentityPoolId = import.meta.env.VITE_API_IDENTITY_POOL_AWS
const sBucketRegion = import.meta.env.VITE_API_BUCKET_REGION_AWS
const sBucketName = import.meta.env.VITE_API_BUCKET_AWS
const BucketParams = {
Bucket: sBucketName,
}
AWS.config.update({
region: sBucketRegion,
credentials: new AWS.CognitoIdentityCredentials({
IdentityPoolId: sIdentityPoolId
})
})
const s3 = new AWS.S3({
apiVersion: '2023-01-01',
params: BucketParams
})
My error is
ReferenceError: global is not defined
Uncaught (in promise) ReferenceError: global is not defined
When I add global variable exemple, it's work in dev project, but when I use npm run build in prod, don't work.
Beta Was this translation helpful? Give feedback.
All reactions