Closed arliber closed 7 years ago
This is a known issue. It's a CORS issue.
You could circumvent this by running wikijs from within a WebWorker, which would be preferred anyway since it will not block the UI thread.
But the real solution of using the JSONP WikiMedia API has not been implemented yet.
Actually, I discovered a new way to circumvent this issue. I'll run some tests and then maybe give a pull request. You can set cors=*
Sounds good. Can't wait to check it out.
@dijs Should be solved with https://github.com/dijs/wiki/pull/40 pull request.
Works perfectly! While not directly related - I tried using wiki under Node 6.9 and since there are no native import I used require instead - and nothing worked (e.g. when executing wiki.page, page was undefined) Does it strictly require next node version? Thanks
Could you show us some example source code. I might know a solution.
On Apr 8, 2017 11:20, "Arik Liber" notifications@github.com wrote:
Works perfectly! While not directly related - I tried using wiki under Node 6.9 and since there are no native impoert I used require instead - and nothing worked (e.g. when executing wiki.page, page was undefined) Does it strictly require next node version? Thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dijs/wiki/issues/39#issuecomment-292728269, or mute the thread https://github.com/notifications/unsubscribe-auth/AIhrIJfzXdVhMSr5Oz5RBjCNipLKlfG1ks5rt7PZgaJpZM4MpG5R .
@LeonLiber I'd highly recommend you open a separate issue, so this can be handled better.
Hi,
I'm trying to use WikiJs directly from the client within webpack environment. Unfortunately, I get the following error:
Fetch API cannot load https://en.wikipedia.org/w/api.php?prop=info%7Cpageprops&inprop=url&ppprop=disambiguation&titles=Batman&format=json&action=query&redirects=. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
which leads to:
Uncaught (in promise) TypeError: Failed to fetch
what am I missing?
Thanks in advance