Code Monkey home page Code Monkey logo

vash-express-example's Introduction

vash-express-example

An example express app built using Vash

vash-express-example's People

Contributors

kirbysayshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vash-express-example's Issues

subdirectories

Took the code vash-express-example as a starting point. Made the directory structure like this
image

changed the code for 1 directory to look like this
image

get error:
image

I know I can change the code globally: app.set('views', path.join( __dirname, '/views') );
But I want to easily to point to views in the views/customers and views/orders

Maximum call stack size exceeded.

I get this error "Maximum call stack size exceeded." when using this example. If I go to ./routes/index.js and change the for loop to be smaller (like 20) it works fine.

Full error:

Connect
500 RangeError: Problem while rendering template at line 23, character 2.
Original message: Maximum call stack size exceeded.
Context:
21 | })
22 |

23 | })
24 |
at Buffer.pushConcat (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1640:18)
at helpers.finishLayout (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2125:25)
at Object.onRenderEnd (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2083:9)
at eval (eval at (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1820:24), :462:44)
at linked (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1860:12)
at c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2082:21
at Object.vash.loadFile (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2070:10)
at View.vash.renderFile as engine
at View.render (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\express\lib\view.js:126:8)
at tryRender (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\express\lib\application.js:639:10)

UnclosedNodeError issue with slash in a comment

I'm newbe using Vash, but I think I found a little bug

I'm getting a UnclosedNodeError processing this template:

@html.extend('layout', function(model){
    @html.block('content', function(model){

        <!-- Banner -->
            <div>Hello!</div>
        <!-- /Banner -->
    })
})

It's due to slash / before Banner If I remove it:

@html.extend('layout', function(model){
    @html.block('content', function(model){

        <!-- Banner -->
            <div>Hello!</div>
        <!-- Banner -->
    })
})

It's works.

Unable to start new project with Vash

Hello,

I'm attempted to start a new Node.js app using Vash. I following this example. I copied the contents of app.js. My package.json is slightly different. Mine looks like this:

{
  "name": "MyApp",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "body-parser": "^1.13.3",
    "cookie-parser": "^1.3.5",
    "debug": "^2.2.0",
    "errorhandler": "^1.4.2",
    "express": "^4.13.3",
    "express-session": "^1.11.3",
    "method-override": "^2.3.5",
    "morgan": "^1.6.1",
    "multer": "^1.0.3",
    "serve-favicon": "^2.3.0",
    "vash": "^0.9.3"
  },
  "scripts": {
    "start": "node app"
  }
}

After running npm install, I run node app.js. At that point, I get an error:

/Users/username/Website/node_modules/express/lib/application.js:209
    throw new TypeError('app.use() requires middleware functions');
          ^
TypeError: app.use() requires middleware functions
    at EventEmitter.use (/Users/username/Website/node_modules/express/lib/application.js:209:11)
    at Object.<anonymous> (/Users/username/Website/app.js:31:5)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

I do not understand why I am getting this error. I also do not understand how to fix it. How do I fix this error?

Thank you!

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.