Simple-schema added checks and now not allowing to provide extra fields like uniforms. Developers need to downgrade to "simpl-schema": "1.5.7"
Even with this version we needed to disable typescript as simpl-schema is strongly typed.
Hi @wtrocki. I guess the problem you are talking about happens only on the type level, not the runtime. The runtime is handled through the SimpleSchema.extendOptions.
When it comes to the types, I wasn't aware, that simpl-schema got typings - that's great news! I wouldn't think of adding it to the package for now, but definitely consider it in the future. What you could do is to extend the SchemaDefinition interface, according to your usage:
declare module 'simpl-schema' {
interface SchemaDefinition {
uniforms?: ...;
}
}
We are doing the same with JSON schema in our projects, as the actual options are not limited to the ones we handle in the core packages. The only problem is that this interface is not exported, so one cannot extend it in the app.
It very much happens at runtime:
function checkAndScrubDefinition(fieldName, definition, options, fullSchemaObj) {
if (!definition.type) throw new Error("".concat(fieldName, " key is missing \"type\"")); // Validate the field definition
Object.keys(definition).forEach(function (key) {
if (schemaDefinitionOptions.indexOf(key) === -1) {
// Fails here
throw new Error("Invalid definition for ".concat(fieldName, " field: \"").concat(key, "\" is not a supported property"));
}
});
Someone also had this issue long time ago which is strange:
https://github.com/vazco/uniforms/issues/122#issuecomment-294585722
Error: Invalid definition for deleted field: "uniforms" is not a supported property
Are you sure you are importing uniforms-bridge-simple-schema-2 (or uniforms-bridge-simple-schema-2/register directly)? If so, try to reproduce it in our sandbox template.
Downgrading simpl-schema package helped to get this running.
Thank you for help.
https://github.com/aerogear/OpenVolunteerPlatform/blob/master/platform/client/package.json#L27
This is coming back like boomerangs.
Simple schema gets updated for sample app and apps stop working.
It is easily reproducible even on the app linked.
"uniforms-bridge-simple-schema-2": "3.0.0-alpha.4",
"simpl-schema": "^1.7.3",
Error: Invalid definition for title field: "uniforms" is not a supported property
Moving to "simpl-schema": "1.5.5", (which is being used in the linked example) all works.
Any reason why this library doesn't contain simpl-schema dependency for people to use:
https://uniforms.tools/docs/api-bridges#simpleschema2bridge
Would it be possible to reopen this issue?
It was just misunderstanding - issue happens at runtime - not related to compilation.

It is definitely in code
@wtrocki - can you check https://github.com/vazco/uniforms/issues/734#issuecomment-634593832 once again? This error is expected to happen if SimpleSchema.extendOptions won't get called. I've just checked it with 1.7.3 and everything works.
Ok. I have a solution.
import SimpleSchema2Bridge from 'uniforms-bridge-simple-schema-2';
import SimpleSchema from 'simpl-schema';
instead of
import SimpleSchema from 'simpl-schema';
import SimpleSchema2Bridge from 'uniforms-bridge-simple-schema-2';
Sorry for making problems
So I got to the bottom why this problem - it is actually failing when code is transpiled using Ionic.
React bundler in ionic does some stuff and it is not loading this properly.
It is soo frustrating as you can have day where build works and another day.