Open bejaeger opened 3 years ago
I'm also currently having this exact error as well. When checking api/v3/getPublicPageData, it gives me a Cloudflare Error 1101.
same issue
If your page created when the format url still using notion.so/username, it was completely safe, checkout my website.
But, if your page was created after the format url changed into username.notion.so it was completely break or even redirected like my Links website.
That's why the reason fruitionsite website are safe.
If your page created when the format url still using notion.so/username, it was completely safe, checkout my website.
But, if your page was created after the format url changed into username.notion.so it was completely break or even redirected like my Links website.
That's why the reason fruitionsite website are safe.
I'm not quite sure if this is the case, since I'm trying to use older version of the code (documented in https://fruitionsite.com/update) and it still gives me the error.
This also looks very similar to the issue faced in #103.
If your page created when the format url still using notion.so/username, it was completely safe, checkout my website. But, if your page was created after the format url changed into username.notion.so it was completely break or even redirected like my Links website. That's why the reason fruitionsite website are safe.
I'm not quite sure if this is the case, since I'm trying to use older version of the code (documented in https://fruitionsite.com/update) and it still gives me the error.
I know, that's why I told you. I have used Notion since 2020 and having many old pages. Since 2021 Notion transforms their URL into a username.notion.so it breaks my new page, then the update of fruitionsite to add some code into the condition on the worker came.
You can check my code and modify your needs. It works on an old page created but breaks if you were create a new page with a message "Continue to external site by following the link below"
/* CONFIGURATION STARTS HERE */
/* Step 1: enter your domain name like fruitionsite.com */
const MY_DOMAIN = 'perogeremmer.com';
const MY_FULL_DOMAIN = 'https://perogeremmer.com';
/*
* Step 2: enter your URL slug to page ID mapping
* The key on the left is the slug (without the slash)
* The value on the right is the Notion page ID
*/
const SLUG_TO_PAGE = {
'': '<your-notion-page-id>'
};
/* Step 3: enter your page title and description for SEO purposes */
const PAGE_TITLE = '';
const PAGE_DESCRIPTION = "";
/* Step 4: enter a Google Font name, you can choose from https://fonts.google.com */
const GOOGLE_FONT = 'Roboto';
/* Step 5: enter any custom scripts you'd like */
const CUSTOM_SCRIPT = ``;
/* CONFIGURATION ENDS HERE */
const PAGE_TO_SLUG = {};
const slugs = [];
const pages = [];
Object.keys(SLUG_TO_PAGE).forEach(slug => {
const page = SLUG_TO_PAGE[slug];
slugs.push(slug);
pages.push(page);
PAGE_TO_SLUG[page] = slug;
});
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request));
});
function generateSitemap() {
let sitemap = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
slugs.forEach(
(slug) =>
(sitemap +=
'<url><loc>https://' + MY_DOMAIN + '/' + slug + '</loc></url>')
);
sitemap += '</urlset>';
return sitemap;
}
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, HEAD, POST, PUT, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
};
function handleOptions(request) {
if (request.headers.get('Origin') !== null &&
request.headers.get('Access-Control-Request-Method') !== null &&
request.headers.get('Access-Control-Request-Headers') !== null) {
// Handle CORS pre-flight request.
return new Response(null, {
headers: corsHeaders
});
} else {
// Handle standard OPTIONS request.
return new Response(null, {
headers: {
'Allow': 'GET, HEAD, POST, PUT, OPTIONS',
}
});
}
}
async function fetchAndApply(request) {
if (request.method === 'OPTIONS') {
return handleOptions(request);
}
let url = new URL(request.url);
url.hostname = 'www.notion.so';
if (url.pathname === '/robots.txt') {
return new Response('Sitemap: https://' + MY_DOMAIN + '/sitemap.xml');
}
if (url.pathname === '/sitemap.xml') {
let response = new Response(generateSitemap());
response.headers.set('content-type', 'application/xml');
return response;
}
let response;
if (url.pathname.startsWith('/app') && url.pathname.endsWith('js')) {
response = await fetch(url.toString());
let body = await response.text();
response = new Response(body.replace(/www.notion.so/g, MY_DOMAIN).replace(/notion.so/g, MY_DOMAIN), response);
response.headers.set('Content-Type', 'application/x-javascript');
return response;
} else if ((url.pathname.startsWith('/api'))) {
// Forward API
response = await fetch(url.toString(), {
body: request.body,
headers: {
'content-type': 'application/json;charset=UTF-8',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'
},
method: 'POST',
});
response = new Response(response.body, response);
response.headers.set('Access-Control-Allow-Origin', '*');
return response;
} else if (slugs.indexOf(url.pathname.slice(1)) > -1) {
const pageId = SLUG_TO_PAGE[url.pathname.slice(1)];
return Response.redirect('https://' + MY_DOMAIN + '/' + pageId, 301);
}
else {
response = await fetch(url.toString(), {
body: request.body,
headers: request.headers,
method: request.method,
});
response = new Response(response.body, response);
response.headers.delete('Content-Security-Policy');
response.headers.delete('X-Content-Security-Policy');
}
return appendJavascript(response, SLUG_TO_PAGE);
}
class MetaRewriter {
element(element) {
if (PAGE_TITLE !== '') {
if (element.getAttribute('property') === 'og:title'
|| element.getAttribute('name') === 'twitter:title') {
element.setAttribute('content', PAGE_TITLE);
}
if (element.tagName === 'title') {
element.setInnerContent(PAGE_TITLE);
}
}
if (PAGE_DESCRIPTION !== '') {
if (element.getAttribute('name') === 'description'
|| element.getAttribute('property') === 'og:description'
|| element.getAttribute('name') === 'twitter:description') {
element.setAttribute('content', PAGE_DESCRIPTION);
}
}
if (element.getAttribute('property') === 'og:url'
|| element.getAttribute('name') === 'twitter:url') {
element.setAttribute('content', MY_DOMAIN);
}
if (element.getAttribute('name') === 'apple-itunes-app') {
element.remove();
}
}
}
class HeadRewriter {
element(element) {
if (GOOGLE_FONT !== '') {
element.append(`<link href="https://fonts.googleapis.com/css?family=${GOOGLE_FONT.replace(' ', '+')}:Regular,Bold,Italic&display=swap" rel="stylesheet">
<style>* { font-family: "${GOOGLE_FONT}" !important; }</style>`, {
html: true
});
}
element.append(`<style>
div.notion-topbar > div > div:nth-child(3) { display: none !important; }
div.notion-topbar > div > div:nth-child(4) { display: none !important; }
div.notion-topbar > div > div:nth-child(5) { display: none !important; }
div.notion-topbar > div > div:nth-child(6) { display: none !important; }
div.notion-topbar-mobile > div:nth-child(3) { display: none !important; }
div.notion-topbar-mobile > div:nth-child(4) { display: none !important; }
div.notion-topbar > div > div:nth-child(1n).toggle-mode { display: block !important; }
div.notion-topbar-mobile > div:nth-child(1n).toggle-mode { display: block !important; }
</style>`, {
html: true
})
}
}
class BodyRewriter {
constructor(SLUG_TO_PAGE) {
this.SLUG_TO_PAGE = SLUG_TO_PAGE;
}
element(element) {
element.append(`<div style="display:none">Powered by <a href="http://fruitionsite.com">Fruition</a></div>
<script>
window.CONFIG.domainBaseUrl = "${ MY_FULL_DOMAIN }";
const SLUG_TO_PAGE = ${JSON.stringify(this.SLUG_TO_PAGE)};
const PAGE_TO_SLUG = {};
const slugs = [];
const pages = [];
const el = document.createElement('div');
let redirected = false;
Object.keys(SLUG_TO_PAGE).forEach(slug => {
const page = SLUG_TO_PAGE[slug];
slugs.push(slug);
pages.push(page);
PAGE_TO_SLUG[page] = slug;
});
function getPage() {
return location.pathname.slice(-32);
}
function getSlug() {
return location.pathname.slice(1);
}
function updateSlug() {
const slug = PAGE_TO_SLUG[getPage()];
if (slug != null) {
history.replaceState(history.state, '', '/' + slug);
}
}
function onDark() {
el.innerHTML = '<div title="Change to Light Mode" style="margin-left: auto; margin-right: 14px; min-width: 0px;"><div role="button" tabindex="0" style="user-select: none; transition: background 120ms ease-in 0s; cursor: pointer; border-radius: 44px;"><div style="display: flex; flex-shrink: 0; height: 14px; width: 26px; border-radius: 44px; padding: 2px; box-sizing: content-box; background: rgb(46, 170, 220); transition: background 200ms ease 0s, box-shadow 200ms ease 0s;"><div style="width: 14px; height: 14px; border-radius: 44px; background: white; transition: transform 200ms ease-out 0s, background 200ms ease-out 0s; transform: translateX(12px) translateY(0px);"></div></div></div></div>';
document.body.classList.add('dark');
__console.environment.ThemeStore.setState({ mode: 'dark' });
};
function onLight() {
el.innerHTML = '<div title="Change to Dark Mode" style="margin-left: auto; margin-right: 14px; min-width: 0px;"><div role="button" tabindex="0" style="user-select: none; transition: background 120ms ease-in 0s; cursor: pointer; border-radius: 44px;"><div style="display: flex; flex-shrink: 0; height: 14px; width: 26px; border-radius: 44px; padding: 2px; box-sizing: content-box; background: rgba(135, 131, 120, 0.3); transition: background 200ms ease 0s, box-shadow 200ms ease 0s;"><div style="width: 14px; height: 14px; border-radius: 44px; background: white; transition: transform 200ms ease-out 0s, background 200ms ease-out 0s; transform: translateX(0px) translateY(0px);"></div></div></div></div>';
document.body.classList.remove('dark');
__console.environment.ThemeStore.setState({ mode: 'light' });
}
function toggle() {
if (document.body.classList.contains('dark')) {
onLight();
} else {
onDark();
}
}
function addDarkModeButton(device) {
const nav = device === 'web' ? document.querySelector('.notion-topbar').firstChild : document.querySelector('.notion-topbar-mobile');
el.className = 'toggle-mode';
el.addEventListener('click', toggle);
nav.appendChild(el);
onLight();
}
const observer = new MutationObserver(function() {
if (redirected) return;
const nav = document.querySelector('.notion-topbar');
const mobileNav = document.querySelector('.notion-topbar-mobile');
if (nav && nav.firstChild && nav.firstChild.firstChild
|| mobileNav && mobileNav.firstChild) {
redirected = true;
updateSlug();
addDarkModeButton(nav ? 'web' : 'mobile');
const onpopstate = window.onpopstate;
window.onpopstate = function() {
if (slugs.includes(getSlug())) {
const page = SLUG_TO_PAGE[getSlug()];
if (page) {
history.replaceState(history.state, 'bypass', '/' + page);
}
}
onpopstate.apply(this, [].slice.call(arguments));
updateSlug();
};
}
});
observer.observe(document.querySelector('#notion-app'), {
childList: true,
subtree: true,
});
const replaceState = window.history.replaceState;
window.history.replaceState = function(state) {
if (arguments[1] !== 'bypass' && slugs.includes(getSlug())) return;
return replaceState.apply(window.history, arguments);
};
const pushState = window.history.pushState;
window.history.pushState = function(state) {
const dest = new URL(location.protocol + location.host + arguments[2]);
const id = dest.pathname.slice(-32);
if (pages.includes(id)) {
arguments[2] = '/' + PAGE_TO_SLUG[id];
}
return pushState.apply(window.history, arguments);
};
const open = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function() {
arguments[1] = arguments[1].replace('${MY_DOMAIN}', 'www.notion.so');
return open.apply(this, [].slice.call(arguments));
};
</script>${CUSTOM_SCRIPT}`, {
html: true
});
}
}
async function appendJavascript(res, SLUG_TO_PAGE) {
return new HTMLRewriter()
.on('title', new MetaRewriter())
.on('meta', new MetaRewriter())
.on('head', new HeadRewriter())
.on('body', new BodyRewriter(SLUG_TO_PAGE))
.transform(res);
}
I have no luck with any of the versions. It actually redirects me to the notion login screen now.
I've been getting this error on and off all day. Still blank screen. The thing is that I'm hosted through hostnotion. Not independently hosted through cloudflare. @hostnotion
I created a worker with wrangler (kind of annoying I can't tail existing workers). The error I got was:
{"name":"TypeError","message":"response.body.delete is not a function","timestamp":1629262161661}
It is on the /api/v3/getPublicPageData
route, so that's at least our debug step.
It has to do with this part of the code:
response = await fetch(url.toString(), {
body: request.body,
headers: {
'content-type': 'application/json;charset=UTF-8',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'
},
method: 'POST',
});
response = new Response(response.body, response);
response.headers.set('Access-Control-Allow-Origin', '*');
if (url.pathname.startsWith('/api/v3/getPublicPageData')) {
response.body.delete('requireInterstitial');
}
So this means that response.body
does not exist, probably because of the 500 error from Notion. But, given that we are getting 500 from Notion on that request, then something in the request or about the request is probably faulty.
However, I've never worked with notion so I have no idea what things to try to solve this. Maybe one of the other devs can use this as a starting point?
This appears to be affecting any service that provides a domain in front of notion. It's kinda a problem in a lot of cases but I am unable to detect if it's a CloudFlare edge problem or not, but seeing as other providers for Notion domains are down I doubt they all use CF and workers so might fully on Notions end.
Given that the CF worker is throwing a JavaScript error and it has to do with response.body.delete
not being a function, I think this is a Notion issue.
If I replace response.body.delete('requireInterstitial')
with just a console.log
, the page renders requiring me to log in:
This tells me that it's trying to access my editor instead of the public URL.
Also, the body on the /api/v3/getPublicPageData
route ends up being:
betaEnabled: false
canJoinSpace: false
canRequestAccess: false
icon: "https://s3-us-west-2.amazonaws.com/public.notion-static.com/51444871-9329-42c5-82d8-a1457bdeab37/pfp1.png"
publicAccessRole: "comment_only"
requireLogin: true
spaceDomain: "darkswordsman"
spaceId: "7eec1f3f-d91a-438c-8103-551bfe46b71c"
spaceName: "Dark's Blog"
This includes the part where requireLogin: true
is set, even though that's the only changed value between the normal notion domain and the custom domain. So something about the CF worker is forcing it to require login. IDK why.
Though, what I'm failing to understand is that the response for the same URL via the worker is:
{
"webSocket": null,
"url": "https://www.notion.so/api/v3/getPublicSpaceData",
"redirected": false,
"ok": true,
"headers": {},
"statusText": "OK",
"status": 200,
"bodyUsed": false,
"body": {
"locked": false
}
}
The "body" you see there with "locked": false
is the same body where it was trying to delete the key for requireInterstitial
.
I have some understanding of JavaScript through webapp development, but I am failing to see how this script is working.
My only conclusion is that notion changed something on their end, so the request it incorrect in some way. I wish I can debug further, but I just simply don't know. We will have to wait for a dev I guess.
Alright, so update:
For the part where it makes a new request on /api
, I added the following code:
const responseTwo = await fetch(url.toString(), {
body: url.pathname.startsWith('/api/v3/getPublicPageData') ? JSON.stringify({
requestedOnPublicDomain: true,
}) : request.body,
headers: {
'content-type': 'application/json;charset=UTF-8',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'
},
method: 'POST',
});
The only part there that is new is:
url.pathname.startsWith('/api/v3/getPublicPageData') ? JSON.stringify({
requestedOnPublicDomain: true,
})
This causes it to work. I am not proposing this as a fix though, because I still have no idea how it works and this is clearly very different from how it was working before. It also probably is very wrong to do it this way.
My only possible guess after analyzing the requests is that cloudflare is not passing the request body and other information from the original request. So this is probably not a notion issue, but a cloudflare one.
I think it has to do with the body: false
I was seeing earlier.
Hopefully the fruition devs can properly fix this or provide some other solution.
Edit: It also appears some sites, even fruition, are still running fine. So I'm not sure how this is possible, unless it's like @perogeremmer mentioned with the URL change.
Either way, very frustrating. Hopefully this is properly resolved.
I also think reason of issue is not:
Observation:
Perhaps a new change at Notion side is now causing a problem with the newest Fruition code
Alright, so update:
For the part where it makes a new request on
/api
, I added the following code:const responseTwo = await fetch(url.toString(), { body: url.pathname.startsWith('/api/v3/getPublicPageData') ? JSON.stringify({ requestedOnPublicDomain: true, }) : request.body, headers: { 'content-type': 'application/json;charset=UTF-8', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36' }, method: 'POST', });
The only part there that is new is:
url.pathname.startsWith('/api/v3/getPublicPageData') ? JSON.stringify({ requestedOnPublicDomain: true, })
This causes it to work. I am not proposing this as a fix though, because I still have no idea how it works and this is clearly very different from how it was working before. It also probably is very wrong to do it this way.
My only possible guess after analyzing the requests is that cloudflare is not passing the request body and other information from the original request. So this is probably not a notion issue, but a cloudflare one.
I think it has to do with the
body: false
I was seeing earlier.Hopefully the fruition devs can properly fix this or provide some other solution.
Edit: It also appears some sites, even fruition, are still running fine. So I'm not sure how this is possible, unless it's like @perogeremmer mentioned with the URL change.
Either way, very frustrating. Hopefully this is properly resolved.
That's what I said 🤣. It's quite frustrating because the old pages worked fine like my website. But it breaks for the new page like my another website. It must be Notion dev changes some flow to redefine the URL for the new page version request.
But actually, something weird with the deeper page, if you're using linked pages for the old version page as I did, it would return the error message "Continue to external site by following the link below" like the new page version.
Fruitionsite is working properly since they're not using linked pages.
I'm not a developer so do shout at me if I'm totally off - when adding the new base URL that Notion provide, ie. the "xyz.notion.site" to _const slug_topage moves me from a 301 fail to a 200 response. I wonder if every "notion.so" URL and reference to it in the Fruition script needs updating to "xyz.notion.site" for consistency. Lmk what you guys think.
Does it also resolve the blank page issue? Because that test you're doing is only the base web app. I had the same 301 status before (and 200 if I did my own domain), but it didn't reflect the 500 of the API route mentioned.
if i did his test correctly, it doesn't work and i still get the api error in the console when i deploy/reload.
same issue to me
same issue
same issue
Same issue with me, yesterday the code worked fine with the new urls. I updated all my links to the new format with no problems, but today all my websites are just blank screens.
Is there an update on this issue?
Is there an update on this issue?
i think we need to wait
adding to the thread here. patiently waiting on a fix.
Ditto
Instead of replying just to get notifications there is a "subscribe" function on the right sidebar of this page. I suggest using that.
Instead of replying just to get notifications there is a "subscribe" function on the right sidebar of this page. I suggest using that.
I was going to mention this as well. Though, the reason I'm replying here now is just to provide an annoying but more stable alternative (in my opinion).
I just ripped out the worker for various reasons and replaced it with redirects and page rules.
The reasons I ripped it out were:
Because this worker redirects all requests, I had 17k requests for 450 unique visitors. This is way too much in my opinion just for me to have a pretty URL. If I'm going to spend money on a cloudflare worker, it would probably be cheaper and easier to just get a Digital Ocean box to do Nginx proxying.
You can see these here:
The only oddity is that only the www
subdomain works at redirecting to my blog. The apex (@
, or root) does not work, so I have to also specify a redirect/rule for @
to www
. But, it works great otherwise, and 192.0.2.1
is just a dummy domain, since we're redirecting anyways.
Maybe one day Fruition can be more stable, or better yet: Notion could actually provide support for custom domains.
Even if it's not the original intent, it is probably my favorite of all the blogging software I have tried. So it's a shame that custom domains don't work.
⭐️ UPDATED: For those who still see the blank page after applying these(#117) changes, please make sure:
Refer to this comment.
Here is a SOLUTION.
But it can absolutely solve these problems we are currently facing with.
All we need to do is make that system think we returned /api/v3/getPublicPageData
with any content, even this JSON content is not relative to Notion, however, we could not just make it return error 500 directly, 500 will let the page shown blank, as many users face with.
I modified the code here, and delete the code here, these changes made it work again. I tried it many times between different Notion pages and domains, and it also brought all of my FruitionSite projects back to life.
Here is what I have changed.
// Modified line 111
body: url.pathname.startsWith('/api/v3/getPublicPageData') ? null : request.body,
// Deleted line 121-123
if (url.pathname.startsWith('/api/v3/getPublicPageData')) {
response.body.delete('requireInterstitial');
}
Complete code is here. See changes on this Pull Request(#117).
Hope this helps.
Great! that works indeed, Harry-Yep, thanks so much.
For some reason I still had the blank screen in the same chrome browser session (even with empty cache and hard reload) and saw the content only when testing the URL in safari or in a private chrome session. Just in case other people experience the same.
Great! that works indeed, Harry-Yep, thanks so much.
For some reason I still had the blank screen in the same chrome browser session (even with empty cache and hard reload) and saw the content only when testing the URL in safari or in a private chrome session. Just in case other people experience the same.
Make sure to clear your browser’s cache before visiting your website, I believe that these changes will be effective in all platforms.
@Harry-Yep Tried this but it didn't work for me. Tried with clearing cache also.
I can confirm that the fix works on my end. Thanks! For those having cache issues, in Cloudflare, try using Development Mode and also purging the cache.
@Harry-Yep I have implemented the changes you suggested in your https://github.com/stephenou/fruitionsite/issues/113#issuecomment-901524424 on the worker, and they worked fine. Website is visible again.
Many thanks,
Luca
@aashay96 Hi, see the update on original comment. Hope this helps.
⭐️ UPDATED: For those who still see the blank page after applying these(#117) changes, please make sure:
- The browser cache has been cleared. (For Chrome User)
- Cloudflare Dev Mode is turned on. (You can turn it off after it works for you.)
- Use other browsers (or Browser Private Mode) or mobile phones to visit your website, these devices or browsers must never visit this website. (Once it works for any device or browser, it would also work for all platforms)
Refer to this comment.
Here is a SOLUTION, even it is not that perfect.
But it can absolutely solve these problems we are currently facing with.
All we need to do is make that system think we returned
/api/v3/getPublicPageData
with any content, even this JSON content is not relative to Notion, however, we could not just make it return error 500 directly, 500 will let the page shown blank, as many users face with.I modified the code here, and delete the code here, these changes made it work again. I tried it many times between different Notion pages and domains, and it also brought all of my FruitionSite projects back to life.
Here is what I have changed.
// Modified line 111 body: url.pathname.startsWith('/api/v3/getPublicPageData') ? null : request.body, // Deleted line 121-123 if (url.pathname.startsWith('/api/v3/getPublicPageData')) { response.body.delete('requireInterstitial'); }
Complete code is here. See changes on this Pull Request(#117).
Hope this helps.
Thank you Harry-Yep, it works for me!
hey. thanks for that. works fine. but there are a few errors in the console. don't know how critical that is or if it needs to be corrected. i'm not a programmer.
and one thing. now the browser does not display the page description.
⭐️ UPDATED: For those who still see the blank page after applying these(#117) changes, please make sure:
- The browser cache has been cleared. (For Chrome User)
- Cloudflare Dev Mode is turned on. (You can turn it off after it works for you.)
- Use other browsers (or Browser Private Mode) or mobile phones to visit your website, these devices or browsers must never visit this website. (Once it works for any device or browser, it would also work for all platforms)
Refer to this comment.
Here is a SOLUTION, even it is not that perfect.
But it can absolutely solve these problems we are currently facing with.
All we need to do is make that system think we returned
/api/v3/getPublicPageData
with any content, even this JSON content is not relative to Notion, however, we could not just make it return error 500 directly, 500 will let the page shown blank, as many users face with.I modified the code here, and delete the code here, these changes made it work again. I tried it many times between different Notion pages and domains, and it also brought all of my FruitionSite projects back to life.
Here is what I have changed.
// Modified line 111 body: url.pathname.startsWith('/api/v3/getPublicPageData') ? null : request.body, // Deleted line 121-123 if (url.pathname.startsWith('/api/v3/getPublicPageData')) { response.body.delete('requireInterstitial'); }
Complete code is here. See changes on this Pull Request(#117).
Hope this helps.
Worked for me! Thankyou bro! I don't know the technicalities behind it but is this a permanent fix?
@leshapetrovskiy This is normal, and it does not interfere with your daily use. Because the code replaces all *.notion.so
with your domain name, therefore, some deep subdomain will return an error.
@patrickbatememan If Notion makes any more changes to their code, or takes a different approach to validation. Then we need to change the code to accommodate the new variations. Unless Notion has a conscious objection to us doing such things. However, I don't think that will happen, because I believe Notion is friendly to all developers.
Works. Many thanks.
Please stop commenting about the solution working. It's better if you just REACT with the emoji!
Hi. I have followed all the instructions here and have the latest code updated on my worker (after I completely deleted the old worker on CloudFlare) and all I get is a blank page. I tried clearing the cache, purging CF cache, turning on CF dev mode, I am completely out of ideas. Can somebody help me out here? What should I do? Thank you very, very much! Website is: https://remgriff.ro/
LE: managed to get it working by deleting the site from CF then redoing the whole Fruition procedure.
Still experiencing the Mismatch between origin and baseUrl (dev).
issue and can reproduce even after following these steps:
For reference, also pasting my original code below:
Thank you in advance for your help!
Still experiencing the
Mismatch between origin and baseUrl (dev).
issue and can reproduce even after following these steps:
- Removing existing worker + route
- Removing my site altogether
- Adding the site back
- Turning on Developer Mode
- Creating a new worker
- Pasting brand new script created from Fruition Site (see below)
- Opening Firefox Private (a browser I haven't used before, i.e. no cache of my site)
- Opening my site (sabol.io)
Brand new Fruition script from no. 6
Okay if you already observed, did you add anything else? Or are you using the same original script from the fruitionsite.com site?
Hi all,
is anyone else facing a blank screen with their webpage? I solved the baseDomain issue and things seem to work yesterday, but now the notion page is not appearing anymore. I have the following in the console log but I'm not sure if this is related to the issue.
Any information would be very helpful, thanks!