Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 40954 invoked from network); 4 Aug 2010 06:13:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Aug 2010 06:13:13 -0000 Received: (qmail 23879 invoked by uid 500); 4 Aug 2010 06:13:12 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 23698 invoked by uid 500); 4 Aug 2010 06:13:10 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 22984 invoked by uid 99); 4 Aug 2010 06:13:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Aug 2010 06:13:09 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Aug 2010 06:13:01 +0000 Received: by qwf7 with SMTP id 7so3817558qwf.11 for ; Tue, 03 Aug 2010 23:12:40 -0700 (PDT) Received: by 10.229.221.70 with SMTP id ib6mr817667qcb.153.1280902360242; Tue, 03 Aug 2010 23:12:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.181.65 with HTTP; Tue, 3 Aug 2010 23:12:20 -0700 (PDT) X-Originating-IP: [121.219.142.144] In-Reply-To: References: From: David Pitman Date: Wed, 4 Aug 2010 16:12:20 +1000 Message-ID: Subject: Re: Help with "compitation_error" an error on CouchDB 0.11.1 on Ubuntu 10.04 - CommonJS Module To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016363b8b802ca0d5048cf9527e X-Virus-Checked: Checked by ClamAV on apache.org --0016363b8b802ca0d5048cf9527e Content-Type: text/plain; charset=ISO-8859-1 Yep, just to confirm that, once again, the machine and CouchDB are completely blameless :) Lack of proper sleep and skim-reading the docs are my problem... got it working now. Thanks. David Pitman On Wed, Aug 4, 2010 at 3:39 PM, David Pitman wrote: > Sorry, just re-read the wiki docs at > http://wiki.apache.org/couchdb/CommonJS_Modules, looks like I > mis-understood how this works with the "exports" variable stuff too. Will > try again after I redo this design doc with a new (and hopefully correct) > understanding of how to use this feature actually works. > > Thanks for your help. > > David Pitman > > > > On Wed, Aug 4, 2010 at 3:18 PM, Nathan Stott wrote: > >> It's too difficult to read a raw design doc. Please post the JS module >> you're interested in. It's also a good idea to run your JS code through >> jslint. Ignore warnings about the "exports" variable being undefined. >> >> On Tue, Aug 3, 2010 at 10:13 PM, David Pitman >> wrote: >> >> > Hi there, >> > >> > I had some code working with the CommonJS Modules feature. It was >> > working just fine, and then after a few minutes it just stopped and >> > instead of "Hello World" I get this error message:--- >> > >> > {"error":"compilation_error","reason":"Module >> > require('html_head/doctype') raised error (new TypeError(\"func is >> > undefined\", \"/usr/local/share/couchdb/server/main.js\", 1106))"} >> > >> > --- >> > >> > My code is for this design document is: >> > >> > --- >> > >> > { >> > "_id": "_design/admin", >> > "_rev": "2-5454cb0680c2574703938cbccbf878ff", >> > "language": "javascript", >> > "html_head": { >> > "doctype": "> > Transitional//EN\" \" >> > >> http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd\ >> > ">", >> > "title": { >> > "add": "Add a New Comment", >> > "edit": "Edit an Existing Comment", >> > "view": "View an Entire Commentary", >> > "see": "See All Commentaries" >> > }, >> > "js": { >> > "jquery": "script type='text/javascript' src=' >> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js >> > '>", >> > "common": "", >> > "add": "", >> > "edit": "", >> > "view": "", >> > "see": "" >> > }, >> > "css": { >> > "common": "", >> > "add": "", >> > "edit": "", >> > "view": "", >> > "see": "" >> > } >> > }, >> > "html_body": { >> > "add": "" >> > }, >> > "views": { >> > "all": { >> > "map": "function(doc) {\n emit(null, doc);\n}" >> > } >> > }, >> > "shows": { >> > "add": "function(doc, req) {var responseObj = {}; >> > responseObj.code=200; responseObj.body = require('html_head/doctype') + >> > '' + require('html_head/title/add') + '' + >> > require('html_head/css/common') + require('html_head/css/add') + >> > require('html_head/js/jquery') + require('html_head/js/common') + >> > require('html_head/js/add') + '' + require('html_body/add') + >> > '';return responseObj}" >> > } >> > } >> > >> > --- >> > >> > I am not new to CouchDB, but am new to CommonJS stuff - is this a bug in >> my >> > code or a bug in CouchDB? >> > >> > Thank you to anyone who has any insight... >> > >> > David Pitman >> > >> > > --0016363b8b802ca0d5048cf9527e--