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

"Lambda handler not found" error due to change in @architect/architect v10.6.0 #109

Closed
LukeAskew opened this issue Oct 11, 2022 · 4 comments
Labels
needs-response We need a response from the original author about the issue

Comments

@LukeAskew
Copy link

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

  1. Upgrade @architect/architect to >=10.6
  2. npm run dev
  3. See error (occasionally)

Expected Behavior

Arc sandbox should detect the server file and run without issue.

Actual Behavior

There is a race condition between remix watch and void arc() that results in arc intermittently not being able to find the server build artifact. This happens pretty consistently on first boot or if the server/ directory is deleted before the build.

@LukeAskew
Copy link
Author

Relevant links:
architect/architect#1330
architect/inventory@b890aba

Here's my fix in dev.js. I'm sure there is a cleaner way, but this might help unblock some folks in the meantime:

process.env.PORT = process.env.PORT ?? 3000;
process.env.ARC_LOCAL = process.env.ARC_LOCAL ?? 1;
process.env.ARC_TABLES_PORT = process.env.ARC_TABLES_PORT ?? 5555;

const { watchFile, unwatchFile } = require("fs");
const { join } = require("path");
const arc = require("@architect/architect");

const server = join(__dirname, "server/index.js");

// Wait until the server is built
watchFile(server, { interval: 100 }, (curr, prev) => {
  if (!prev.size && curr.size) {
    void arc();
    unwatchFile(server);
  }
});

@jeffstahlin
Copy link

Just ran into this issue as well and tried the fix @LukeAskew suggested but it didn't work. Restarting the server seemed to fix the problem though.

@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the needs-response We need a response from the original author about the issue label Apr 17, 2023
@github-actions
Copy link
Contributor

This issue has been automatically closed because we didn't hear anything from the original author after the previous notice.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-response We need a response from the original author about the issue
Projects
None yet
Development

No branches or pull requests

2 participants