d4rekanguok / netlify-ssg-cache

WIP
1 stars 0 forks source link

Not working #1

Open d4rekanguok opened 5 years ago

d4rekanguok commented 5 years ago

@d4rekanguok - after looking over your PoC, it seems unlikely you meant for it to be used in tandem with the existing netlify cache plugin. I went ahead and installed it on a branch with deploy previews on my site, added your new package to my package.json, modified my netlify.toml to use the netlify:build command, and added that to my package.json scripts as well. Unfortunately, the deploy preview seemed pretty upset. First, the console statements for the build were repetitively duplicated, this one being the primary offender but the regular console statements caused by Netlify installing dependencies and then Gatsby's own output were streaming by repeated as well: WARN lifecycle The node binary used for scripts is /tmp/yarn--1570735894857-0.265146341432166/node but npm is using /opt/buildhome/.nvm/versions/node/v10.16.3/bin/node itself. Use the--scripts-prepend-node-pathoption to include the path for the node binary npm was executed with. There were two errors thrown that I saw: Error: ENOENT: no such file or directory, open '/opt/build/repo/.cache/fragmen ts/image-sharp-fragments.js' And: You specified a fileNode, but we caught an error. First check that you have gatsby-source-filesystem installed? 3:33:32 PM: failed to process https://dl.airtable.com/.attachments/1e9cbcb06edf1928d7610fc301307c28/78f4ce62/2019-10-0813.47.05.jpg 3:33:32 PM: Error: ENOENT: no such file or directory, stat '/opt/build/repo/.cache/gatsby-source-filesystem/tmp-46b0e3af61ff545694aad48c35d6becb.jpg' That last one also includes one of my remote images, as you'll see ....

@jamessimone I'm quite confused as most of those don't look like it could be caused by this plugin (except for maybe the duplicated console statement stuff). Would you be open to let me dig around your repo to debug this?

jamessimone commented 5 years ago

I know, not my proudest moment in terms of relating information. Neither the duplicated logs or other exceptions were thrown on my standard builds though.

I can’t grant access to my repo, which is why I was looking to make an MVP repo with just the references to remote images. I will have some more time today, though, to work on standing something up that might help.

I also saw your note on the other chain and am interested in experimenting with the Netlify cache plugin some more to see if I can reproduce your experience in it seemingly working. I will follow up with more info later today!

On Oct 11, 2019, at 1:46 AM, Derek Nguyen notifications@github.com wrote:

@d4rekanguok - after looking over your PoC, it seems unlikely you meant for it to be used in tandem with the existing netlify cache plugin. I went ahead and installed it on a branch with deploy previews on my site, added your new package to my package.json, modified my netlify.toml to use the netlify:build command, and added that to my package.json scripts as well. Unfortunately, the deploy preview seemed pretty upset. First, the console statements for the build were repetitively duplicated, this one being the primary offender but the regular console statements caused by Netlify installing dependencies and then Gatsby's own output were streaming by repeated as well: WARN lifecycle The node binary used for scripts is /tmp/yarn--1570735894857-0.265146341432166/node but npm is using /opt/buildhome/.nvm/versions/node/v10.16.3/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with. There were two errors thrown that I saw: Error: ENOENT: no such file or directory, open '/opt/build/repo/.cache/fragmen ts/image-sharp-fragments.js' And: You specified a fileNode, but we caught an error. First check that you have gatsby-source-filesystem installed? 3:33:32 PM: failed to process https://dl.airtable.com/.attachments/1e9cbcb06edf1928d7610fc301307c28/78f4ce62/2019-10-0813.47.05.jpg 3:33:32 PM: Error: ENOENT: no such file or directory, stat '/opt/build/repo/.cache/gatsby-source-filesystem/tmp-46b0e3af61ff545694aad48c35d6becb.jpg' That last one also includes one of my remote images, as you'll see ....

@jamessimone I'm quite confused as most of those don't look like it could be caused by this plugin (except for maybe the duplicated console statement stuff). Would you be open to let me dig around your repo to debug this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jamessimone commented 5 years ago

@d4rekanguok I created an extremely stripped down repo with an example image referenced in local markdown but remotely hosted. Hopefully this will help in validating that either this plugin or the work it sounds like you are doing to modify the existing gatsby-plugin-netlify-cache is working as intended with remote sources cached between builds.

My thought on that subject would be to pass in a list of cache/nameOfPlugin options, though it does seem in trawling through the cache folder that the gatsby-source-filesystem folder may be a required entry in moving over. As for handling cache invalidation, all of the plugins that I care about caching all handle invalidation themselves ... which is pretty convenient, for sure. Otherwise, I'm very interested to hear your thoughts on potentially handling the invalidation in a more generic fashion.

d4rekanguok commented 5 years ago

@jamessimone Cool, thanks for the minimal repo! I have only looked at it briefly, but it doesn't seem to differ my test repo linktoo much except for the image plugin stuff. I'll have a closer look once I have a break again.

Let me know if modifying gatsby-plugin-netlify-cache is working for you!

jamessimone commented 5 years ago

I was doing some testing for modifying the existing Netlify cache plugin but I just started a new contract and have been bogged down with work all of the sudden. Once things quiet down I hope to return to this!

On Oct 14, 2019, at 10:09 PM, Derek Nguyen notifications@github.com wrote:

 @jamessimone Cool, thanks for the minimal repo! I have only looked at it briefly, but it doesn't seem to differ my test repo linktoo much except for the image plugin stuff. I'll have a closer look once I have a break again.

Let me know if modifying gatsby-plugin-netlify-cache is working for you!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.