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

Errors in session-data-defaults.js get swallowed and do not crash the kit #2416

Open
edwardhorsford opened this issue Jan 17, 2025 · 1 comment

Comments

@edwardhorsford
Copy link
Contributor

If there is a syntax error or bug in session-data-defaults.js it seems like these errors get swallowed.

If I introduce an error, the kit keeps running - if you restart the kit, it seems the data isn't loaded at all - but as a user it's hard to tell this has happened - you'd have to have a good idea what was wrong.

Even if you know there's an issue with the file, without the raw error it's hard to work out what the error was.

Chatting with @nataliecarey it seems this section of the code is responsible:

let sessionDataDefaults
const sessionDataDefaultsFile = path.join(projectDir, 'app', 'data', 'session-data-defaults.js')
try {
sessionDataDefaults = require(sessionDataDefaultsFile)
} catch (e) {
sessionDataDefaults = {}
}

What I'd expect

Ideally the kit would crash and show an error.

@nataliecarey
Copy link
Contributor

I've raised a PR with the fix for this: #2417

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

2 participants