Hi, I want use uniform without meteor. can you show me an example??
I am using webpack and React.js + simpl-schma
@radekmie thanks for your reply. I'm trying below steps:
npm install --save react react-dom uniforms uniforms-bootstrap3npm install simpl-schema --save schema.js file and write schema like this:import SimpleSchema from 'simpl-schema';
const PersonSchema = new SimpleSchema({
name: {
type: String,
min: 3,
max: 50
},
age: {
type: Number,
min: 0,
max: 150
}
});
const PostSchema = new SimpleSchema({
category: {
type: String,
allowedValues: [
"news",
"image",
"video"
]
},
authors: {
type: [PersonSchema],
minCount: 1,
maxCount: 3
},
publishedDate: {
type: Date
},
published: {
type: Boolean,
optional: true
}
});
export default PostSchema;
form.jsx import React from 'react';
import {render} from 'react-dom';
import {AutoForm} from 'uniforms-bootstrap3';
import PostSchema from './schema.js';
const PostCreateForm = () =>
<AutoForm schema={PostSchema} onSubmit={doc => console.log(doc)} />
;
export default PostCreateForm;
But unfortunately when I run my project I give the below error as output:
WARNING in ./~/uniforms/lib/bridges/GraphQLBridge.js
Critical dependencies:
55:18-25 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/uniforms/lib/bridges/GraphQLBridge.js 55:18-25
WARNING in ./~/uniforms/lib/bridges/SimpleSchema2Bridge.js
Critical dependencies:
71:23-30 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/uniforms/lib/bridges/SimpleSchema2Bridge.js 71:23-30
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Cannot resolve module 'fs' in /home/username/projects/test3/Files/react/FormReact/node_modules/handlebars/lib
@ ./~/handlebars/lib/index.js 17:11-24
That's a bug. I've found a solution to suppress Meteor's warning about a not found module. It's here. It looks like it broke non-meteor package resolvers... OK, I'll try to fix it.
I've made a separate issue for it: #150.
It's fixed in v1.8.0.
@radekmie thanks for your rapid fix! You are hero :wink:
Got the exact same bug using webpack and uniforms v1.15.0 and simpl-schema v0.2.3
@Astroxslurg what is the problem exactly?
Well, I did pretty much exactly the same as OP, and got exactly the same error.
I'm not in any trouble tho', because I'm just working on a small project atm and I solved my problem using standard HTML after I got stuck with Uniforms. But I thought I could mention the bug in case it were of any interest :)
Thank you for your time then. I'll get to it in a minute and let you know what's going on.
Great! :)
Let me know if you need more info or something
@Astroxslurg:
create-react-app reproduction
cd reproduction
npm i -S simpl-schema uniforms{,-unstyled}
I see warnings from both, handlebars and GraphQLBridge, but these are only warnings. What error exactly have you encountered?
I also get theese kind of warnings:
WARNING in ./~/handlebars/lib/index.js
require.extensions is not supported by webpack. Use a loader instead.
@ ./~/message-box/dist/MessageBox.js 13:18-39
@ ./~/simpl-schema/dist/SimpleSchema.js
@ ./~/simpl-schema/dist/main.js
@ ./client/questions/classroom.jsx
@ ./client/core/main.jsx
but also this one error:
ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Can't resolve 'fs' in '/home/username/pu-69/interlecture/interlecture/node_modules/handlebars/lib'
@ ./~/handlebars/lib/index.js 17:11-24
@ ./~/message-box/dist/MessageBox.js
@ ./~/simpl-schema/dist/SimpleSchema.js
@ ./~/simpl-schema/dist/main.js
@ ./client/questions/classroom.jsx
@ ./client/core/main.jsx
It seem to be a handlebars/webpack problem. Long story short simpl-schema -> message-box -> handlebars. I can't help you then, but I hope these workarounds will suffice.
All right! Thanks for your time, once again, @radekmie :)
which packege i have to update to avoid these warnings ??
simpleschema or uniforms??
@waheed25: which warnings?
meteor warnings
@waheed25: there are no Meteor warnings for a long time now - just update the uniforms package. And by the way - this issue is about non-Meteor warnings.
it seems the warnings still appear in webpack + uniforms + uniforms-bootstrap3
"webpack": "^3.8.1",
"react": "^16.0.0",
"uniforms": "^1.22.0",
"uniforms-bootstrap3": "^1.22.0",
when doing the following
import AutoForm from 'uniforms-bootstrap3/AutoForm';
then webpack triggers following warnings
WARNING in ./node_modules/uniforms/GraphQLBridge.js
Module not found: Error: Can't resolve 'graphql' in '/home/app/node_modules/uniforms'
@ ./node_modules/uniforms/GraphQLBridge.js 48:14-26
@ ./node_modules/uniforms/createSchemaBridge.js
@ ./node_modules/uniforms/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/ValidatedQuickForm.js
@ ./node_modules/uniforms-bootstrap3/AutoForm.js
@ ./src/app/js/index.js
@ multi ./src/app/js/index.js
WARNING in ./node_modules/uniforms/SimpleSchemaBridge.js
Module not found: Error: Can't resolve 'meteor/aldeed:simple-schema' in '/home/app/node_modules/uniforms'
@ ./node_modules/uniforms/SimpleSchemaBridge.js 84:23-55
@ ./node_modules/uniforms/createSchemaBridge.js
@ ./node_modules/uniforms/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/ValidatedQuickForm.js
@ ./node_modules/uniforms-bootstrap3/AutoForm.js
@ ./src/app/js/index.js
@ multi ./src/app/js/index.js
WARNING in ./node_modules/uniforms/SimpleSchemaBridge.js
Module not found: Error: Can't resolve 'meteor/check' in '/home/app/node_modules/uniforms'
@ ./node_modules/uniforms/SimpleSchemaBridge.js 80:16-33
@ ./node_modules/uniforms/createSchemaBridge.js
@ ./node_modules/uniforms/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/ValidatedQuickForm.js
@ ./node_modules/uniforms-bootstrap3/AutoForm.js
@ ./src/app/js/index.js
@ multi ./src/app/js/index.js
WARNING in ./node_modules/uniforms/SimpleSchema2Bridge.js
Module not found: Error: Can't resolve 'simpl-schema' in '/home/app/node_modules/uniforms'
@ ./node_modules/uniforms/SimpleSchema2Bridge.js 60:19-36
@ ./node_modules/uniforms/createSchemaBridge.js
@ ./node_modules/uniforms/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/BaseForm.js
@ ./node_modules/uniforms-bootstrap3/ValidatedQuickForm.js
@ ./node_modules/uniforms-bootstrap3/AutoForm.js
@ ./src/app/js/index.js
@ multi ./src/app/js/index.js
Yep it is, because there's no way to hide them. There's an idea to split schemas in future releases, but definitely not in @1.x.y as it's a breaking change.
@radekmie Is there another open ticket for this? Seems like if this is going to be fixed in 2.x it should be on someone's radar, but this ticket is closed. It would be a shame if version 2 came out without fixing this.
@redbmk it is on our roadmap.
I am facing the same issue (https://github.com/vazco/uniforms/issues/148#issuecomment-340818096).
Any updates here?
Not really. Nothing changed in terms of expressing dependencies, nor uniforms@2 are on the way (yet).
Most helpful comment
it seems the warnings still appear in webpack + uniforms + uniforms-bootstrap3
when doing the following
then webpack triggers following warnings