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

Code for managing a missing home page is broken #2414

Open
joelanman opened this issue Oct 16, 2024 · 0 comments
Open

Code for managing a missing home page is broken #2414

joelanman opened this issue Oct 16, 2024 · 0 comments

Comments

@joelanman
Copy link
Contributor

joelanman commented Oct 16, 2024

Description of the issue

If /app/views/index.html is missing, the kit crashes with error:

node:internal/fs/promises:639
  return new FileHandle(await PromisePrototypeThen(
                        ^

Error: ENOENT: no such file or directory, open '/Users/joe.lanman/prototypes/dds/node_modules/govuk-prototype-kit/prototype-starter/app/views/index.njk'
    at async open (node:internal/fs/promises:639:25)
    at async Object.readFile (node:internal/fs/promises:1242:14)
    at async /Users/joe.lanman/prototypes/dds/node_modules/govuk-prototype-kit/server.js:172:31 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/joe.lanman/prototypes/dds/node_modules/govuk-prototype-kit/prototype-starter/app/views/index.njk'
}

If other pages are missing, the kit handles it correctly with the 404 page.

I think this was introduced in this PR which was supposed to render a home page even if one was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant