4

Purpose: Upload images from quasar project to aws amplify storage.

Installations : aws-amplify library for quasar and vuejs.

=> aws-amplify uses @aws-sdk for built in.

Once this code is added :

import { Amplify, Storage } from 'aws-amplify';

Amplify.configure(config);

I try to build my project: quasar -m build pwa/android/ios throws this error :

'request' is not exported by __vite-browser-external, imported by node_modules/@aws-sdk/credential-provider-imds/dist/es/remoteProvider/httpRequest.js

I saw on github for @aws-sdk this is a common error with vite.

I'm using quasar 2.6.0, aws-amplify 4.3.35

Any suggestions or workaround ?

belhadj haythem
  • 622
  • 2
  • 6
  • 16
  • Not a 1:1 issue relation, but I found this when getting a different `aws-sdk` error https://ui.docs.amplify.aws/react/getting-started/troubleshooting#vite – Alex Ironside Dec 29 '22 at 12:01

1 Answers1

7

in quasar.config.js file, you can add below in build section :

extendViteConf(viteConf, { isClient, isServer }) {
    Object.assign(viteConf.resolve.alias, {
      './runtimeConfig': './runtimeConfig.browser',
    });
  },
belhadj haythem
  • 622
  • 2
  • 6
  • 16