Closed yaripey closed 3 years ago
Hmmm, that page loads and works perfectly well for me though.
It might not be related to the webview if the tab doesn't open at all. If so can you check and share the error log in the console if any exists? You can open the console from Help > Toggle Developer Tools
.
I'm having a similar problem. The test page opens just fine, but a non-test page doesn't do anything.
It gives me this:
I'm having the same problem!
Does the error persist? I mean
And can you guys open this URL https://notion-api.frenco.dev/v1/page/320213fb70ba48169059a17fa9dc195c? To check if it's caused by the server in your VPN area or not.
And yes, the link is openable in any browser. It returns a JSON with info about the page.
It is definitely a weird bug, it's not reproducible on my machine, and according to the log, the error comes from this line
if (Object.keys(res.data).length < 1) {
throw new Error("Couldn't load the data from API.")
}
which is only the case when the data return from API looks like this,
{}
If viewing the API in the browser doesn't look like that, it's super weird. Then, the only case possible would be that res.data
is null
. I have no idea why it would be though.
May I know your VSCode version, and basic information about your machine model so that I can go through VSCode issues and check for one similar to the case? You can get the version from code -v
.
Results from code -v
:
1.52.1
ea3859d4ba2f3e577a159bc91e3074c5d85c0523
x64
Here is my VSCode about text.
My machine is Huawei MateBook D14, AMD Ryzen 5 3500U.
Though, there are other people who has the same bug, I doubt there is something to do with the machine.
Omg I think I know what the error is. I parse the notion URL to get the ID using a regex something like this,
const pattern = /(?:https?:\/\/)?(?:www\.)?notion\.so\/([\w\.-]*)*\/?/
so it only matches public links without a username, so you have to use it as
# like this
https://www.notion.so/Test-page-for-VSCode-notion-extension-320213fb70ba48169059a17fa9dc195c
# not like this
https://www.notion.so/yaripey/Test-page-for-VSCode-notion-extension-320213fb70ba48169059a17fa9dc195c
You can get the absolute URL from the Share > Copy Link
in Notion.
v1.0.1 will contain a fix for this, by parsing URLs containing usernames. Feel free to reopen the issue if you think it's not the culprit after trying in v1.0.1.
Yes! Without username it works fine. The only note I would like to make is that Share > Copy Link
still adds username to the path, at least for me. So the only way to obtain a working absolute link is to remove the username from the path manually. Good to hear that it will be fixed in v1.0.1, waiting for it. Thanks.
GETTING ERROR AGAIN! error is = "Couldn't load the data from API. "
Same
Currently getting the same issue, but when copying the link in notion there is no user or file path to change. I copy and paste to VScode and I get the "Couldn't load the date from API" or "Request failed with status code 404" errors in the bottom right corner. I am not running a VPN. I tried to publish the page and add it to a workgroup neither resolved the issue.
Hi there. I can't open anything from Notion with this extension. For example, this page. I can open it in browser, but the VSCode just shows
VSCode Notion: Loading...
in the bottom right corner for 2-3 seconds and dissapears. Nothing else happens. Maybe I need to provide some additional info?