-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
TypeError: NetworkError when attempting to fetch resource. #51
Comments
Hi @appw-cn, thanks for the feedback! I haven't seen this error before, so I'm not sure exactly what's causing it. Could you provide a couple more pieces of information for me?
Thanks! |
@daniboy23 thanks for the screenshot! Would you mind trying some commands in Zotero's JavaScript console? You can open it from Tools → Developer → Run JavaScript. Once you open it, please enable the Run as async function option. First, I'd like to see if we can perform a basic network request. Paste the following code and click Run. return fetch('https://www.zotero.org/').then(response => response.text()); Do you see HTML content in the right panel, or do you see an error? If you see an error, please let me know what it is. If you see HTML, let's try performing a request to the Notion API. const databaseID = Zotero.Prefs.get('extensions.notero.notionDatabaseID', true);
const notionToken = Zotero.Prefs.get('extensions.notero.notionToken', true);
const headers = {
'Authorization': `Bearer ${notionToken}`,
'Notion-Version': '2022-02-22'
};
return fetch(
`https://api.notion.com/v1/databases/${databaseID}`,
{ headers }
).then(response => response.json()); Can you let me know what the result of this is? Thanks! |
Hi @dvanoni Thank you for your response. I have done the first half of your message and received an HTML: How would I now perform the request to the Notion API in the second half of your message? Thank you! |
I also noticed that if I insert the first code into the Java program and click run multiple times, certain elements of the return message changes |
@daniboy23 thanks for running those! It seems that network requests in general are working—we can see that fetching Could you provide some more info to help me debug?
Thanks! |
Thanks for looking into this! |
@daniboy23 there doesn't seem to be anything out of the ordinary there. 🤔 Out of curiosity, what result do you get if you run this in the console? return fetch('https://api.notion.com/').then(response => response.text()); |
@dvanoni This was the return message: |
Ah sorry @daniboy23, I forgot to mention: please enable the Run as async function option. |
@dvanoni Oops, sorry here is the message: |
Hmm interesting. @daniboy23 what happens if you open https://api.notion.com in your browser? |
@dvanoni Very interesting! That worked. Do you know why it worked now so that I can try to fix it on my own in the future? Thank you so much for all of you help! |
@daniboy23 do you mean that the plugin is working correctly now and able to sync items into Notion? |
@dvanoni It did work yesterday, but not today. I noticed I cannot open https://api.notion.com in my browser today like I could yesterday. |
@daniboy23 Huh, well that's interesting. It sounds like it might be something related to your internet provider or DNS provider. Would you mind sending a screenshot of your browser when you try to open the URL? I'm curious to see what the specific error message is. Thanks! |
@dvanoni I am getting one of these: I think this could be something I could check with for IT services at my job site tomorrow. I might also try to sync on my personal computer in a couple of hours too when I'm on my home WiFi. I will let you know if I get different results. Thank you for your help! |
@dvanoni It seems to be working on my home Wifi so this is apparently a work network issue which I should be able to get fixed on my end. Thank you again so much for your help! 10/10 |
thanks everyone. |
I ran into this issue as well. It is the problem of VPN. Thanks for the above solution. |
Hi,
thanks for your briliant work!
I installed, but it doesn't work, and show this message:
Saving items to Notion...
Item 1 of 1
TypeError: NetworkError when attempting to fetch resource.
Do you know how can I solve it ?
Appreciated!
The text was updated successfully, but these errors were encountered: