Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC8B09454 for ; Wed, 28 Sep 2011 01:17:08 +0000 (UTC) Received: (qmail 71412 invoked by uid 500); 28 Sep 2011 01:17:08 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 71364 invoked by uid 500); 28 Sep 2011 01:17:08 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 71312 invoked by uid 99); 28 Sep 2011 01:17:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2011 01:17:07 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2011 01:17:06 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D254528CD89 for ; Wed, 28 Sep 2011 01:16:45 +0000 (UTC) Date: Wed, 28 Sep 2011 01:16:45 +0000 (UTC) From: "Paul Joseph Davis (Reopened) (JIRA)" To: dev@couchdb.apache.org Message-ID: <1618120448.1916.1317172605863.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2113904873.17865.1310746260709.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Reopened] (COUCHDB-1223) require() an empty file will throw error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1223?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Joseph Davis reopened COUCHDB-1223: ---------------------------------------- Apparently I can't edit the resolution. =20 > require() an empty file will throw error > ---------------------------------------- > > Key: COUCHDB-1223 > URL: https://issues.apache.org/jira/browse/COUCHDB-1223 > Project: CouchDB > Issue Type: Bug > Reporter: Johnny Weng Luu > > When the file I require() is empty CouchDB throws an error. > {"error":"compilation_error","reason":"Module require('kanso/core') raise= d error [\"error\", \"compilation_error\", \"Module require('lib/app') rais= ed error [\\\"error\\\", \\\"invalid_require_path\\\", \\\"Object has no pr= operty \\\\\\\"views\\\\\\\". {\\\\\\\"views\\\\\\\":\\\\\\\"\\\\\\\",\\\\\= \\"app\\\\\\\":\\\\\\\"/**\\\\\\\\u000a * Values exported from this module = will automatically be used to generate\\\\\\\\u000a * the design doc pushed= to CouchDB.\\\\\\\\u000a */\\\\\\\\u000a\\\\\\\\u000amodule.exports =3D {\= \\\\\\\u000a types: require('./types'),\\\\\\\\u000a shows: require('= ./shows'),\\\\\\\\u000a lists: require('./lists'),\\\\\\\\u000a views= : require('./views'),\\\\\\\\u000a updates: require('./updates'),\\\\\\\= \u000a filters: require('./filters'),\\\\\\\\u000a rewrites: require(= './rewrites'),\\\\\\\\u000a validate_doc_update: require('./validate'),\= \\\\\\\u000a events: require('./events')\\\\\\\\u000a};\\\\\\\\u000a\\\\= \\\",\\\\\\\"events\\\\\\\":\\\\\\\"/**\\\\\\\\u000a * Bindings to Kanso ev= ents\\\\\\\\u000a */\\\\\\\\u000a\\\\\\\\u000avar events =3D require('kanso= /events');\\\\\\\\u000a\\\\\\\\u000a\\\\\\\\u000a/**\\\\\\\\u000a * The ini= t method fires when the app is initially loaded from a page rendered\\\\\\\= \u000a * by CouchDB.\\\\\\\\u000a */\\\\\\\\u000a\\\\\\\\u000a/**\\\\\\\\u0= 00a * events.on('init', function () {\\\\\\\\u000a * // app initializat= ion code goes here...\\\\\\\\u000a * });\\\\\\\\u000a */\\\\\\\\u000a\\\\\\= \\u000a\\\\\\\\u000a/**\\\\\\\\u000a * The sessionChange event fires when t= he app is first loaded and the user's\\\\\\\\u000a * session information be= comes available. It is also fired whenever a change\\\\\\\\u000a * to the u= ser's session is detected, for example after logging in or out.\\\\\\\\u000= a */\\\\\\\\u000a\\\\\\\\u000a/**\\\\\\\\u000a * events.on('sessionChange',= function (userCtx, req) {\\\\\\\\u000a * // session change handling co= de goes here...\\\\\\\\u000a * });\\\\\\\\u000a */\\\\\\\\u000a\\\\\\\\u000= a\\\\\\\\u000a/**\\\\\\\\u000a * The updateFailure event fires when an upda= te function returns a document as\\\\\\\\u000a * the first part of an array= , but the client-side request to update the\\\\\\\\u000a * document fails.\= \\\\\\\u000a */\\\\\\\\u000a\\\\\\\\u000aevents.on('updateFailure', functio= n (err, info, req, res, doc) {\\\\\\\\u000a alert(err.message || err.toS= tring());\\\\\\\\u000a});\\\\\\\\u000a\\\\\\\",\\\\\\\"filters\\\\\\\":\\\\= \\\"/**\\\\\\\\u000a * \\\\\\\\u000a */\\\\\\\",\\\\\\\"lists\\\\\\\":\\\\\= \\"/**\\\\\\\\u000a * Lists\\\\\\\\u000a */\\\\\\\",\\\\\\\"rewrites\\\\\\\= ":\\\\\\\"//---------------------------------------------------------------= ---------------\\\\\\\\u000a// Init\\\\\\\\u000a//-------------------------= -----------------------------------------------------\\\\\\\\u000a//-------= -----------------------------------------------------------------------\\\\= \\\\u000a// Rewrites\\\\\\\\u000a//----------------------------------------= --------------------------------------\\\\\\\\u000amodule.exports =3D [{\\\= \\\\\u000a \\\\\\\\\\\\\\\"method\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"GET\\\\= \\\\\\\\\\\",\\\\\\\\u000a \\\\\\\\\\\\\\\"from\\\\\\\\\\\\\\\": \\\\\\\\\= \\\\\\"/tests\\\\\\\\\\\\\\\",\\\\\\\\u000a \\\\\\\\\\\\\\\"to\\\\\\\\\\\\= \\\": \\\\\\\\\\\\\\\"_show/tests\\\\\\\\\\\\\\\"\\\\\\\\u000a}, {\\\\\\\\u= 000a \\\\\\\\\\\\\\\"method\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"*\\\\\\\\\\\\= \\\",\\\\\\\\u000a \\\\\\\\\\\\\\\"from\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"*= \\\\\\\\\\\\\\\",\\\\\\\\u000a \\\\\\\\\\\\\\\"to\\\\\\\\\\\\\\\": \\\\\\\= \\\\\\\\"../../../*\\\\\\\\\\\\\\\"\\\\\\\\u000a}];\\\\\\\",\\\\\\\"shows\\= \\\\\":\\\\\\\"//----------------------------------------------------------= --------------------\\\\\\\\u000a// Init\\\\\\\\u000a//--------------------= ----------------------------------------------------------\\\\\\\\u000avar = templates =3D require('kanso/templates');\\\\\\\\u000a\\\\\\\\u000a//------= ------------------------------------------------------------------------\\\= \\\\\u000a// Shows\\\\\\\\u000a//------------------------------------------= ------------------------------------\\\\\\\\u000aexports.tests =3D function= (doc, req) {\\\\\\\\u000a\\\\\\\\u000a var scripts =3D templates.render('t= ests.html', req, {});\\\\\\\\u000a \\\\\\\\u000a var body =3D templates.r= ender('base.html', req, {\\\\\\\\u000a \\\\\\\\\\\\\\\"title\\\\\\\\\\\\= \\\": \\\\\\\\\\\\\\\"Jasmine Spec Runner\\\\\\\\\\\\\\\",\\\\\\\\u000a = \\\\\\\\\\\\\\\"scripts\\\\\\\\\\\\\\\": scripts,\\\\\\\\u000a \\\\\\\\\= \\\\\\"content\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\u00= 0a });\\\\\\\\u000a\\\\\\\\u000a return {\\\\\\\\u000a \\\\\\\\\\\\\\\= "headers\\\\\\\\\\\\\\\": {\\\\\\\\u000a \\\\\\\\\\\\\\\"Content-Type\= \\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"text/html\\\\\\\\\\\\\\\"\\\\\\\\u000a = },\\\\\\\\u000a \\\\\\\\\\\\\\\"body\\\\\\\\\\\\\\\": body\\\\\\\\u000a = };\\\\\\\\u000a\\\\\\\\u000a};\\\\\\\\u000a\\\\\\\\u000aexports.not_found = =3D function(doc, req) {\\\\\\\\u000a return {\\\\\\\\u000a \\\\\\\\\\\= \\\\"title\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\"404 - Not Found\\\\\\\\\\\\\\\"= ,\\\\\\\\u000a \\\\\\\\\\\\\\\"content\\\\\\\\\\\\\\\": templates.render= ('404.html', req, {})\\\\\\\\u000a };\\\\\\\\u000a};\\\\\\\",\\\\\\\"types= \\\\\\\":\\\\\\\"/**\\\\\\\\u000a * \\\\\\\\u000a */\\\\\\\",\\\\\\\"update= s\\\\\\\":\\\\\\\"/**\\\\\\\\u000a * \\\\\\\\u000a */\\\\\\\",\\\\\\\"valid= ate\\\\\\\":\\\\\\\"//-----------------------------------------------------= -------------------------\\\\\\\\u000a// Init\\\\\\\\u000a//---------------= ---------------------------------------------------------------\\\\\\\\u000= avar types =3D require('kanso/types'),\\\\\\\\u000a app_types =3D requir= e('./types');\\\\\\\\u000a\\\\\\\\u000a//----------------------------------= --------------------------------------------\\\\\\\\u000a// Validate\\\\\\\= \u000a//-------------------------------------------------------------------= -----------\\\\\\\\u000a/**\\\\\\\\u000aValidates document to be created/up= dated.\\\\\\\\u000a\\\\\\\\u000aValidation\\\\\\\\u000a----------\\\\\\\\u0= 00a- One per design document\\\\\\\\u000a- If multiple validation functions= exist for a database, all of them will be run. If one throws error the cre= ate/update is blocked.\\\\\\\\u000a\\\\\\\\u000aFunctions used inside the v= alidate function\\\\\\\\u000a-------------------------------------------\\\= \\\\\u000a- throw({unauthorized: message}) // Throws an unauthorized error = and blocks the update.\\\\\\\\u000a- throw({forbidden: message}) // Throws = a forbidden error and blocks the update.\\\\\\\\u000a\\\\\\\\u000a\\\\\\\\u= 000a@param {Object} newDoc Document from the client.\\\\\\\\u000a@param {Ob= ject} oldDoc Existing document in the database.\\\\\\\\u000a@param {Object}= userCtx User information.\\\\\\\\u000a**/\\\\\\\\u000amodule.exports =3D f= unction(newDoc, oldDoc, userCtx) {\\\\\\\\u000a types.validate_doc_update(= app_types, newDoc, oldDoc, userCtx);\\\\\\\\u000a};\\\\\\\"}\\\"]\"]"} > When I add a comment in it the error disappears. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira