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

Localhost CORS error #180

Open
weaklysubjective opened this issue Mar 27, 2023 · 2 comments
Open

Localhost CORS error #180

weaklysubjective opened this issue Mar 27, 2023 · 2 comments

Comments

@weaklysubjective
Copy link

Hi,

Thank you for the wonderful software. Been testing the webengine and had no trouble following the instructions :

@weaklysubjective
Copy link
Author

oops hit submit too soon : As i was saying , i had no trouble following the instructions i.e. : # Setup emscripten path.
source $PATH_TO_EMSDK/emsdk_env.sh

Build stellarium-web-engine.js and stellarium-web-engine.wasm

This will also copy the files into html/static/js

make js

Now see apps/simple-html/ to try the library in a browser. . However after the page loaded some of the config settings, like the menu settings, tooltips etc do not seem to load. This is because when running from localhost, it runs into CORS Access issue where the backend stellarium link is not loaded : backend: {

  loadPath: 'https://stellarium.sfo2.cdn.digitaloceanspaces.com/' +
            'i18n/v1/{{ns}}/{{lng}}.json'
}

Any clues how to solve this ? Thanks

@weaklysubjective
Copy link
Author

I found issues #35 and #85 relating to CORS. You suggested use of localhost:8080, and I made sure to run the server using localhost and port 8080. The CORS errors is gone (reading from console), but access is forbidden (403) for this part of the html ---> // Setup i18next for translations.
i18next.use(i18nextXHRBackend).init({
lng: 'en',
ns: ['gui', 'skyculture'],
debug: false,
backend: {
loadPath: 'https://stellarium.sfo2.cdn.digitaloceanspaces.com/' +
'i18n/v1/{{ns}}/{{lng}}.json'
}
}); . Any suggestions ?

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