Closed stevenwoodson closed 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?
Sure I'll do it, will get to it in the next couple days!
Oh my gosh, wow. Thank you!
PR ready for review, it worked but with one caveat I noted in the PR description.
Closing via this great PR: https://github.com/ericwbailey/a11y-webring.club/pull/67. Thank you again for doing this!
@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
.
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.
New PR started, it's working but my familiarity with Netlify is minimal so I'd appreciate some additional validation!
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
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.
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)
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
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.
It works! 🎉 🥳
YAY
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
54 and #55 were replaced by #56
57 was replaced with #58
I did see that you fairly quickly fixed that with #59 but I can imagine that manual work can get tedious.
Potential Solution
I could work up a proof of concept but am fairly sure you can create a directory under
data
(likemembers
) and then folks can create individual JSON files therein, rather than all collected in one file.Code of conduct