GithubHelp home page GithubHelp logo

Comments (5)

nickewansmith avatar nickewansmith commented on June 26, 2024

Issue due to order of variables?

from d-bootstrap.

lefnire avatar lefnire commented on June 26, 2024

did you mean to close the ticket, or did you actually get it working again? I'm experiencing the same issue with other components: HabitRPG/habitica#864 - i believe recent changes in Derby may have broken its component library functionality.

from d-bootstrap.

enjalot avatar enjalot commented on June 26, 2024

by order of variables do you mean order of including the components?
i used derby new to test this:
https://github.com/enjalot/derby-demo

found out I had to put all the component includes, i.e. derby.use(...) before the call to derby.createApp

submitted a pull request to derby

from d-bootstrap.

nickewansmith avatar nickewansmith commented on June 26, 2024

Yes, I found something about this "before the call to derby.createApp" on Google.

I'm pretty sure that I did not change anything in my code before the components just stopped working... but I couldn't be completely certain so I closed the issue. No one else seemed to be having any issues, lol.

I ended up resolving the issue by re-ordering my requires based on the statement above.

I think I ordered them so that there is no possible way that things can go wrong? I am pretty new to Derby and Node so maybe someone else would have suggestions.

Ex.

//Server
var
http = require('http')
, express = require('express')
, expressApp = express()
, server = module.exports = http.Server(expressApp)
, path = require('path')
, gzippo = require('gzippo')
, MongoStore = require('connect-mongo')(express)
, racer = require('racer-db-mongo')
, dbUri = 'mongodb://localhost/yourdatabase'
, serverError = require('./serverError')
, ONE_YEAR = 1000 * 60 * 60 * 24 * 365
, root = path.dirname(path.dirname(__dirname))
, publicPath = path.join(root, 'public')

//get derby
var derby = require('derby')
derby.use(derby.logPlugin)
derby.use(racer)
//other stuff derby will use is in the app, as well as the derby.createApp function
var app = require('../app')
//not really sure if this should be here, but just incase
module.exports = server

//create derby stores
//init derby auth
//etc
//start server

from d-bootstrap.

lefnire avatar lefnire commented on June 26, 2024

Yep, turns out derby.createApp has to come after component initialization
in lib/app/index.js after all. Twas news to me as well. Glad you found it

On Saturday, April 27, 2013, Nicholas Smith wrote:

Yes, I found something about this "before the call to derby.createApp" on
Google.

I'm pretty sure that I did not change anything in my code before the
components just stopped working... but I couldn't be completely certain so
I closed the issue. No one else seemed to be having any issues, lol.

I ended up resolving the issue by re-ordering my requires based on the
statement above.

I think I ordered them so that there is no possible way that things can go
wrong? I am pretty new to Derby and Node so maybe someone else would have
suggestions.

Ex.

//Server
var

http = require('http')

, express = require('express')
, expressApp = express()
, server = module.exports = http.Server(expressApp)
, path = require('path')
, gzippo = require('gzippo')
, MongoStore = require('connect-mongo')(express)
, racer = require('racer-db-mongo')
, dbUri = 'mongodb://localhost/yourdatabase'

, serverError = require('./serverError')
, ONE_YEAR = 1000 * 60 * 60 * 24 * 365
, root = path.dirname(path.dirname(__dirname))
, publicPath = path.join(root, 'public')

//get derby
var derby = require('derby')
derby.use(derby.logPlugin)
derby.use(racer)
//other stuff derby will use is in the app, as well as the derby.createApp
function
var app = require('../app')
//not really sure if this should be here, but just incase
module.exports = server

//create derby stores
//init derby auth
//etc
//start server


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-17117427
.

from d-bootstrap.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.