From user-return-11854-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Aug 04 05:18:56 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 6972 invoked from network); 4 Aug 2010 05:18:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Aug 2010 05:18:56 -0000 Received: (qmail 85359 invoked by uid 500); 4 Aug 2010 05:18:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 85058 invoked by uid 500); 4 Aug 2010 05:18:51 -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 85050 invoked by uid 99); 4 Aug 2010 05:18:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Aug 2010 05:18:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nrstott@gmail.com designates 209.85.216.52 as permitted sender) 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 05:18:44 +0000 Received: by qwf7 with SMTP id 7so3784788qwf.11 for ; Tue, 03 Aug 2010 22:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=PxrPIJLqtrYjKrwf6ku62flo0aMgWZi+ewBOl0+6wro=; b=YExKCMbxYoWnI666VETuOidNnjja29OztaDpo9DawBkKV2rubUo4ouGPv8o2ungVaB W2Rvuo1CLs2fX87Mq/jmckGpPe6DyJKWj1f/2FuO148J2zuo4KWGuSth3ogedQQgzB9s DeMH2vU77DAGN2fOjrhPNGdA68pg1mBHhK8S0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=mEbzfd02rbNle1sp3Rfb2mk8bOpMkYN6xlOW6lgn1ph16E7L47b7qSRuWIjxR4o1Cc 7I6gCbENo+70uswVxSkgkXCGExwuIYXIvUy+6ytXCPnpbkGBG30AewFyY84clrSRBPf9 R5dZwGXqlAc1wgpMWTmEa4LRfZ7XtmJCGiJxA= MIME-Version: 1.0 Received: by 10.229.37.83 with SMTP id w19mr1859417qcd.185.1280899104036; Tue, 03 Aug 2010 22:18:24 -0700 (PDT) Received: by 10.229.251.8 with HTTP; Tue, 3 Aug 2010 22:18:23 -0700 (PDT) In-Reply-To: References: Date: Wed, 4 Aug 2010 00:18:23 -0500 Message-ID: Subject: Re: Help with "compitation_error" an error on CouchDB 0.11.1 on Ubuntu 10.04 - CommonJS Module From: Nathan Stott To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001636426d0716db2d048cf890b9 --001636426d0716db2d048cf890b9 Content-Type: text/plain; charset=ISO-8859-1 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 > --001636426d0716db2d048cf890b9--