Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'request' is not exported by __vite-browser-external #2648

Closed
3 tasks done
subhendukundu opened this issue Aug 6, 2021 · 5 comments
Closed
3 tasks done

Error: 'request' is not exported by __vite-browser-external #2648

subhendukundu opened this issue Aug 6, 2021 · 5 comments
Labels
closed-for-staleness p3 This is a minor priority issue

Comments

@subhendukundu
Copy link

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
I am trying to use @aws-sdk/client-sns with esbuild but won't build echoing an error Error: 'request' is not exported by __vite-browser-external.

I have tried to use this which doesnt fix the issue. https://github.com/aws-amplify/amplify-js/issues/7499#issuecomment-804386820

A reproducible example would be https://github.com/subhendukundu/worker-auth-providers/tree/discord/example

Are there any workarounds to fix it?

@trivikr trivikr transferred this issue from aws/aws-sdk-js Aug 6, 2021
@klarkc
Copy link

klarkc commented Aug 19, 2021

Related #2478

@subhendukundu in the related issue there is a PR to fix the same kind of problem, might be useful

@Fanna1119
Copy link

i solved it with the following

  resolve: {
    alias: [
      {
        find: '@', replacement: path.resolve(__dirname, './src'),
      },
      {
        find: './runtimeConfig', replacement: './runtimeConfig.browser',
      }

    ]
  }

@t-lock
Copy link

t-lock commented Apr 29, 2022

https://ui.docs.amplify.aws/getting-started/installation#vite

A sub-product of amplify also suggests what @Fanna1119 is using above, although pared down:

  resolve: {
    alias: [
      {
        find: "./runtimeConfig",
        replacement: "./runtimeConfig.browser",
      },
    ],
  },

Suitable workaround for me.

@RanVaknin RanVaknin added the p3 This is a minor priority issue label Feb 22, 2023
Copy link

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Feb 23, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-for-staleness p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

5 participants