meteor can`t include simpleSchema

250 views Asked by At

first of all, I want to say that im a newbie in meteor and I been looking for a solution for 3 hours but I dont find it. I hope my question helps other newbies like me.

Im working with an Inspinia seed proyect and Im testing and learning how to use simple-schema, collection2 and autoform. I followed all the installation tutorial from that packages and it seems there is all correct. When I tried to create a simpleSchema and run meteor, the console says: "SyntaxError: import declarations may only appear at top level of a module"

I put "import SimpleSchema from 'simpl-schema'; SimpleSchema.extendOptions(['autoform']);" in the same .js where are my schemas. My question is where I have to put this 2 lines? What is the top of the module here? If I dont put this the error says "ReferenceError: SimpleSchema is not defined". I can see in node_modules/simpl-schema the package so I think is well add to the project. There is something im not understanding so I hope someone can help me. Im using [email protected] this might be the problem?

Sorry if this question is answered in other post, I try to look all the posts but I dont find it.

PD: English is not my language so excuse me if I write wrong.

Edit:

Here is where I put the import because I dont know where is this top of module. Where did I have to put it? schema.js is inside client Thanks for the help

0

There are 0 answers