Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

quasar vuejs amplify Error: 'request' is not exported by __vite-browser-external,

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 ?

like image 636
belhadj haythem Avatar asked Oct 27 '25 15:10

belhadj haythem


1 Answers

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

extendViteConf(viteConf, { isClient, isServer }) {
    Object.assign(viteConf.resolve.alias, {
      './runtimeConfig': './runtimeConfig.browser',
    });
  },
like image 74
belhadj haythem Avatar answered Oct 29 '25 05:10

belhadj haythem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!