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

Unexpected string #24

Open
arunabhdas opened this issue Jul 21, 2015 · 3 comments
Open

Unexpected string #24

arunabhdas opened this issue Jul 21, 2015 · 3 comments

Comments

@arunabhdas
Copy link

After running
==> compound init myapp
and
==> npm install
and
==> compound generate scaffold list name
and
==> node .
I get the following error :
express deprecated app.configure: Check app.get('env') in an if statement config/environment.js:6:9
connect deprecated methodOverride: use method-override npm module instead config/environment.js:16:25
express deprecated app.configure: Check app.get('env') in an if statement config/environments/development.js:6:9
undefined:26
List = describe 'List', ->
^^^^^^
SyntaxError: Unexpected string
at Function (native)
at loadSchema (/work-ssd/compoundjs/myapp/node_modules/jugglingdb/lib/railway.js:107:18)
at init (/work-ssd/compoundjs/myapp/node_modules/jugglingdb/lib/railway.js:74:9)
at initialize (/work-ssd/compoundjs/myapp/node_modules/jugglingdb/index.js:94:13)
at Object.exports.init (/work-ssd/compoundjs/myapp/node_modules/jugglingdb/index.js:83:9)
at /work-ssd/compoundjs/myapp/node_modules/compound/lib/server/extensions.js:27:23
at Array.forEach (native)
at init (/work-ssd/compoundjs/myapp/node_modules/compound/lib/server/extensions.js:25:18)
at CompoundServer.module.exports as extensions
at CompoundServer.initCompound (/work-ssd/compoundjs/myapp/node_modules/compound/lib/compound.js:127:14)
at CompoundServer.initCompoundServer as init
at /work-ssd/compoundjs/myapp/node_modules/compound/lib/compound.js:84:22
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3

@nsallis
Copy link

nsallis commented Jul 11, 2016

I know this is late, but the problem seams to be in schema.js. The generated code:
List = describe 'List', -> property('name', String); set 'restPath', pathTo.lists

does not work. Replace it with define ('List', function(){ property('name', String); set('restPath', pathTo.lists); });

like the example says. You may also have to add this line to your list.js model definition: name: { type: String };. I'm not sure that gets defined automatically.

@iekumdario
Copy link

I was struggling with this too. The generator is creating CoffeeScript code. Renaming the file to schema.coffee and changing the block comment to ### instead of /* */ (or deleting it) is another workaround. My guess was that to use the generator with CoffeeScript you had to use --coffee but it does so without the flag. Also the model is created with no attributes.

@yohanesgultom
Copy link

yohanesgultom commented Aug 16, 2017

After some digging, I found out that the problem is caused by outdated co-generators code in npm registry. Pointing directly to the github repository in generated/scaffolded project's package.json & reinstalling the packages fix this issue:

    "devDependencies": {
       ...
        "co-generators": "git://github.com/compoundjs/generators.git"
    },

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

4 participants