ericwbailey / a11y-webring.club

🌐 A webring for digital accessibility practitioners.
https://a11y-webring.club/
MIT License
35 stars 86 forks source link

Looks like some overlapping PRs remove other recent additions #60

Closed stevenwoodson closed 1 year ago

stevenwoodson commented 1 year ago

Your issue

👋 Got the notification that my PR was merged so I took a peek and realized that a few of us had changes overwritten by future merges. Looks like

Potential Solution

I could work up a proof of concept but am fairly sure you can create a directory under data (like members) and then folks can create individual JSON files therein, rather than all collected in one file.

Code of conduct

ericwbailey commented 1 year ago

Oh, I love this idea! Is this something you'd like to take on, or something I should mark as help wanted?

stevenwoodson commented 1 year ago

Sure I'll do it, will get to it in the next couple days!

ericwbailey commented 1 year ago

Oh my gosh, wow. Thank you!

stevenwoodson commented 1 year ago

PR ready for review, it worked but with one caveat I noted in the PR description.

ericwbailey commented 1 year ago

Closing via this great PR: https://github.com/ericwbailey/a11y-webring.club/pull/67. Thank you again for doing this!

ericwbailey commented 1 year ago

@stevenwoodson Looks like there's one last little bit to be hooked up. I get the following error when trying to navigate to the next webring member:

Runtime.ImportModuleError - Error: Cannot find module '../../data/members.json' Require stack: - /var/task/functions/common/utils.js - /var/task/functions/next.js - /var/task/next.js - /var/runtime/index.mjs

Stack trace:

Runtime.ImportModuleError: Error: Cannot find module '../../data/members.json' Require stack:

  • /var/task/functions/common/utils.js
  • /var/task/functions/next.js
  • /var/task/next.js
  • /var/runtime/index.mjs at _loadUserApp (file:///var/runtime/index.mjs:1000:17) at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1035:21) at async start (file:///var/runtime/index.mjs:1200:23) at async file:///var/runtime/index.mjs:1206:1

Similar errors for the previous and random links.

It looks like we have to update this bit in utils.js.

stevenwoodson commented 1 year ago

Oh no! Sorry about that I wasn't aware other parts of the codebase relied on that structure. Okay let me check it out and report back.

stevenwoodson commented 1 year ago

New PR started, it's working but my familiarity with Netlify is minimal so I'd appreciate some additional validation!

ericwbailey commented 1 year ago

Slightly different error this time, but this signals process to me!

Runtime.ImportModuleError - Error: Cannot find module 'glob' Require stack: - /var/task/functions/common/utils.js - /var/task/functions/random.js - /var/task/random.js - /var/runtime/index.mjs

Stack trace:

Runtime.ImportModuleError: Error: Cannot find module 'glob' Require stack:

  • /var/task/functions/common/utils.js
  • /var/task/functions/random.js
  • /var/task/random.js
  • /var/runtime/index.mjs at _loadUserApp (file:///var/runtime/index.mjs:1000:17) at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1035:21) at async start (file:///var/runtime/index.mjs:1200:23) at async file:///var/runtime/index.mjs:1206:1
stevenwoodson commented 1 year ago

Thanks for being willing to give these a try on prod! Just opened PR #79.

I did some more digging and decided to instead use the FileSystem module native to Node (fs) so we can bypass the glob error altogether.

We didn't 100% need to only find JSON files because we can be reasonably sure that directory is only going to include all files we want to compile into members so it's no loss, just a different strategy to do the same thing.

ericwbailey commented 1 year ago

Here's the latest error I'm seeing:

Error - ENOENT: no such file or directory, scandir './data/members'

Stack trace:

Error: ENOENT: no such file or directory, scandir './data/members' at Object.readdirSync (node:fs:1405:3) at Object. (/var/task/functions/common/utils.js:30:4) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/var/task/functions/next.js:1:20) at Module._compile (node:internal/modules/cjs/loader:1105:14)

stevenwoodson commented 1 year ago

Okay, thanks for trying! I'm going to dive in and start a trial Netlify account to debug quicker on my ow first before opening another PR

stevenwoodson commented 1 year ago

Just opened PR #81!

Of course, it was a one line fix. Once I got a Netlify account set up and able to test myself it was easier to figure out.

stevenwoodson commented 1 year ago

It works! 🎉 🥳

ericwbailey commented 1 year ago

YAY