-
Notifications
You must be signed in to change notification settings - Fork 23
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
Page data is trying to be loaded from the path prefix #6
Comments
thanks for reporting! Skipper sounds a lot like Zalando 😂 It seems to be the correct behaviour. Pathprefix tels gatsby to look for everything in that folder. I'm not sure if you need pathprefix for your use case. Where should gatsby look for the page-data.json in your use case? (mydomain.com/page-data/clp/summer-dresses/page-data.json) |
Yes I work for Zalando. I replaced the The page loads fine if I dont use this plugin but then if I access 'mydomain.com/clp/summer-dresses' the page loads but then url is now So I tried this plugin but now when I load
The page loads partially but with exceptions
So I assumed I dont need the failing page-data.json. The first requested json has everything. This one is extra and not needed. |
From what I see this line from
Its trying to load the page-data from the browser path while the data is in the I just noticed Im not completely sure what this page-data is needed for. This is how much I know so far. |
sweet thanks, I forgot to override the preloader. Page-data is the manifest file per page to know which assets to load/preload for a given page. |
I'll try to get it fixed today, if not I'll do it tomorrow. |
@wardpeet cool cool. thank you very much for looking into this. |
Hi Ward, is the fix ready yet? |
Published in version 0.1.1. Sorry for keeping you waiting. |
So I don't completely understand the plugin life cycle. But it seems the line in production app still gets executed and thus the error still happens. Is the order of the plugin in |
I assume the plugin is trying to override the |
we still need to call loadPage for the current page to execute javascript. Any chance you can make a videor or share a public url with the issue you're having. |
Unfortunately we dont have a instance of our proxy(skipper) publicly available for development purposes. You just use the following commands
Create
You can then run the proxy with The page is actually available at |
@wardpeet I got a url that reproduces the issue now. It is https://www-de.release.zalando.net/zlnclp/summer-dress-f |
@Blessenm we're actually using skipper as well as a router (thanks for open-sourcing it, btw!). I may be able to help you :) What we're doing is we're not using pathprefix, but assetPrefix, so all static files are loaded from a different domain/path (in you case, it could either be What is the path prefix that you're adding in your gatsby-config? Skipper instance seems to be down right now. |
Sorry for being late to the party. Is it possible to create a docker container which I can easily run? Also could you share your gatsby-config with us? We will have to download a page-data.json file. Where should they be located for your use case? |
@wardpeet: does this works for you?
|
@xavivars thanks for reproducing this. The docker image works. @wardpeet The correct pagedata.json is already available at Here is my
|
I managed to find out what is happening, but I have no idea why:
@wardpeet any idea why that may be happening? |
@xavivars Possibly stupid question, is the loader not replaced because it's set as a |
I don't think so... we're actually not changing the loader itself, but some of its functions... and what I don't understand is why |
Thanks for all this info! I have found the issue, we override the window.__loader variable but we don't change any code that is used with import statements. I'll need to set the loader instance for gatsby and not just for the window object. I have to think about this how I should solve this 🤔. xavivars any chance you can send me the source code of your docker stuff so I can fiddle with it 👍. This is really great! <3 |
I mean, the docker stuff I built was just with @Blessenm's information, so not even sure it's worth publish 😝 But in any case, here you have! Glad to help (and selfish! I have identically the same problem!!! ) |
But isn't this just holding a reference to the same instance? https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/cache-dir/production-app.js#L28 |
Tried to find out why this may be happening, but didn't succeed. I still don't get why the instance of I may be missing something about how javascript handles global variables |
So I think the overwrite of the loader is happening from here in So the default |
But, as far as I read it in here, in |
@wardpeet Will you be able to look into this any time soon? |
Sorry taking a few days holiday because it's so hot. I'll see if I can get to it in the weekend. Link to PR? |
So I played around with @xavivars changes in gatsby and tried to do a rebuild on the default starter blog with skipper infront of it. This line fails as But still the |
findMatchPath shouldn't be a blocker anymore, the PR just got merged. |
One of the last gatsby versions have broke this Plugin as well so I'm looking into this to get this fixed. I fixed the prodloader so I should have a PR up today or tomorrow |
@wardpeet sounds great. thanks |
@wardpeet im not sure, should the fix be in gatsby core or this plugin? |
Also interested on the answer for @Blessenm question |
@wardpeet any chances this gets done anytime soon (just to know it, not requesting it ;) )? |
@xavivars I just updated gatsby to the latest version. But when I enable this plugin the page fails with an exception from the Are things working for u? and is this issue fixed? |
Last tests I did, all assets were being used downloaded properly, but react crashed (blank page) when rehydrating... So in terms of:is fully working? No. Are all files being downloaded properly? Yes. Still need to figure out what is happening with the rehydration, but I'm leaving for a long vacationing now, so I most likely I won't be able to dive into it any time soon |
I tracked down the issue, only can reproduce it from gatsby 2.13.62 and below. in 2.13.63 manifest.webmanifest is forced to have the assetPrefix removed, which makes it crash when using this plugin, but that is to be fixed later, once we fix the current one. It seems that loadPageSync is returning undefined, so in EnsureResources, specifically this line: Playing around with the loaders in the windowI found that this this is same issue as #10 and #5 @wardpeet any ideas? |
@apaniel90vp
this seems to fix the exception. but the page still navigates away when the browser url and the gatsby url are different |
thanks @Blessenm! I think that what you found is another issue, I think that there must be some problem with the prefetch. that loadPageSync is trying to get the page before prefetch is executed, I am still investigating |
Hi, I just tried this plugin as my page was redirecting after it loaded.
So basically I have gatsby site running from
example.s3.aws.com
with path prefixgatsby
There is one route for this site
example.s3.aws.com/de-DE/summer-dresses
So I configured my proxy (In house proxy named
skipper
used in my company)So now when I try to access the page from
mydomain.com/clp/summer-dresses
the page loads except one file which thepage-data.json
It is looking for the file in the path
mydomain.com/gastby/page-data/clp/summer-dresses/page-data.json
and fails which makes sense.Im wondering if this issue is related this issue.
Any help with this would be appreciated
The text was updated successfully, but these errors were encountered: