spin
spin copied to clipboard
Received runtime error that should be thrown at component build time
Received the below error when running spin up. I incorrectly capitalized the variables in my spin.toml file, and this caused some delays when the app succeeded after spin build, but failed at runtime. Can we have this error at build time, rather than runtime?
Error: invalid variable name: "DB_URL": invalid character 'D'. Variable names may contain only lower-case letters, numbers, and underscores.
We used to fully load the manifest at build time, but it threw up a lot of irrelevant “you need to fix this completely different thing before you can find out why the borrow checker is mad” errors. It was derailing so we made it more forgiving. That said:
- Spin 2 introduced a better pipeline for manifest loading. Spin 1 had a monolithic loader which meant anything wrong would fail the load. So reading the whole manifest may be less derailing now.
- We could rearrange things so that
spin builddoes the build regardless and also does a validation pass on the manifest. This would allow us to report validation failures at build time without them being derailing.