Skip to content
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

Looks like some overlapping PRs remove other recent additions #60

Closed
1 task done
stevenwoodson opened this issue Jan 27, 2023 · 15 comments
Closed
1 task done

Looks like some overlapping PRs remove other recent additions #60

stevenwoodson opened this issue Jan 27, 2023 · 15 comments
Assignees
Labels
being discussed This issue is in active and a conversation is happening to decide what to do about it.

Comments

@stevenwoodson
Copy link

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

  • I agree to follow this project's code of conduct
@stevenwoodson stevenwoodson added the needs triage This issue needs attention before it can be addressed label Jan 27, 2023
@ericwbailey ericwbailey added being discussed This issue is in active and a conversation is happening to decide what to do about it. and removed needs triage This issue needs attention before it can be addressed labels Jan 30, 2023
@ericwbailey
Copy link
Owner

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

@stevenwoodson
Copy link
Author

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

@ericwbailey
Copy link
Owner

Oh my gosh, wow. Thank you!

stevenwoodson pushed a commit to stevenwoodson/a11y-webring.club that referenced this issue Jan 31, 2023
…ther than all added to a single members.json file.
@stevenwoodson
Copy link
Author

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

stevenwoodson pushed a commit to stevenwoodson/a11y-webring.club that referenced this issue Feb 2, 2023
ericwbailey added a commit that referenced this issue Feb 4, 2023
@ericwbailey
Copy link
Owner

Closing via this great PR: #67. Thank you again for doing this!

@ericwbailey
Copy link
Owner

@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
Copy link
Author

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 pushed a commit to stevenwoodson/a11y-webring.club that referenced this issue Feb 5, 2023
…at relied on the previous format of all members in one static file. Changed to use `glob` to import all files into the members array instead.
stevenwoodson pushed a commit to stevenwoodson/a11y-webring.club that referenced this issue Feb 5, 2023
@stevenwoodson
Copy link
Author

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

@ericwbailey
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

It works! 🎉 🥳

@ericwbailey
Copy link
Owner

YAY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
being discussed This issue is in active and a conversation is happening to decide what to do about it.
Projects
None yet
Development

No branches or pull requests

2 participants