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

CORS Issue In Vue #14

Open
dalezak opened this issue Sep 21, 2022 · 0 comments
Open

CORS Issue In Vue #14

dalezak opened this issue Sep 21, 2022 · 0 comments

Comments

@dalezak
Copy link

dalezak commented Sep 21, 2022

I'm running into CORS issue trying to use this with Vue.

Access to fetch at 'https://webservices.amazon.com/paapi5/searchitems' from origin 'http://localhost:8100' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I added the following to vue.config.js so the library was able to require crypto, http, https, and stream.

module.exports = {
  configureWebpack: {
    resolve: {
      fallback: {
        http: require.resolve('stream-http'),
        https: require.resolve('https-browserify'),
        crypto: require.resolve('crypto-browserify'),
        stream: require.resolve('stream-browserify')
      }
    }
  }
};

Has anyone else had any luck using this with Vue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant