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

Access-Control-Allow-Origin #4

Open
olaferlandsen opened this issue Oct 10, 2017 · 17 comments
Open

Access-Control-Allow-Origin #4

olaferlandsen opened this issue Oct 10, 2017 · 17 comments

Comments

@olaferlandsen
Copy link

Hi Adriano,
This "work" but with this error:

Failed to load https://maps.googleapis.com/maps/api/place/autocomplete/json?input=gooogle&key=xxx: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

Have you idea if it still work?

@souzadriano
Copy link
Owner

Hi @olaferlandsen,

This is a CORS problem in development.

In development I use the chrome extension Allow-Control-Allow-Origin: * and configure maps.googleapis.com in the URL patterns.

@olaferlandsen
Copy link
Author

I know it, but why you don't use jsonp???

@souzadriano
Copy link
Owner

Thanks @olaferlandsen, I will search and try change to jsonp if better.

@acittar
Copy link

acittar commented Jan 31, 2018

Hi Adriano,

I installed the chrome extension but I get the same error. How did you configured it?

Thanks,
Alessandro

@souzadriano
Copy link
Owner

Hi @acittar,

Try this:
image

@ishan123456789
Copy link

ishan123456789 commented Feb 21, 2018

Not able to solve it using the plugin.Please suggest a fix or way through.
screen shot 2018-02-21 at 11 06 21 am

@souzadriano
Copy link
Owner

Hi @ishan123456789

With below configs works for me:
image

What Ionic version you use?

@ishan123456789
Copy link

`cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.2
Cordova Platforms  : android 6.4.0
Ionic Framework    : ionic-angular 3.9.2

System:

ios-sim : 6.1.2
Node    : v8.9.4
npm     : 5.6.0
OS      : OS X Yosemite
Xcode   : Xcode 7.2 Build version 7C68

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro`

@ishan123456789
Copy link

I solved the issue by adding another extension ie.

https://chrome.google.com/webstore/detail/cors-goggle/jioikioepegflmdnbocfhgmpmopmjkim/related?hl=en

The one you referred did not help

@acittar
Copy link

acittar commented Feb 22, 2018

Guys,

with the chrome extension Allow-Control-Allow-Origin: * configured as Adriano said, I just have to disable and re-enable it when I open my app in a new tab

image

Thanks,
Alessandro

@acittar
Copy link

acittar commented Mar 20, 2018

Hi Adriano,

sorry, I still have this problem in my production environment. Do you have any idea about how can I fix it?

Thanks,
Alessandro

@ishan123456789
Copy link

This shouldn't be an issue on mobile app. As CORS issue is not relevant to mobile apps

@acittar
Copy link

acittar commented Mar 21, 2018

Sure, but what if a user accesses my app via browser?

@acittar
Copy link

acittar commented Apr 9, 2018

Hi Adriano,

do you have any news on this? The plugin works perfectly for Android/iOS app (I didn't try but I think so), but it doesn't work at all for PWA. I deployed my PWA on heroku and it doesn't work if my chrome plugin is disabled.

Thanks a lot,
Alessandro

@souzadriano
Copy link
Owner

Hi @acittar ,

I don't use as PWA.

I think that is a server configuration.

How is your server configured?

You can try this:
https://devdactic.com/deploy-ionic-website-heroku/
with CORS configurations.

@acittar
Copy link

acittar commented Apr 17, 2018

Hi Adriano,

Tried a lot of configurations to allow CORS but without success. Are you going to switch to jsonp in the next future? It should solve the issue even in local env.

Thanks,
Alessandro

@neharuparel
Copy link

I am still getting the CORS issue in production mode also in my ionic application.
Has anyone solved the issue and how please let me know.

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

No branches or pull requests

5 participants