Giter VIP home page Giter VIP logo

Comments (3)

johnvh avatar johnvh commented on July 18, 2024

Repro w/ punch @ 0.1.2

Simple setup:

$ find .
.
./config.json
./contents
./contents/index.json
./public
./public/index.html
./templates
./templates/index.mustache

$ cat contents/index.json 
{"title": "demo"}

$ cat templates/index.mustache 
<h1>{{title}}</h1>

$ punch .
Generating Site...
Created public/index.html

Simulate editing index.mustache with vim by creating a dummy swap file:

$ touch templates/.index.mustache.swp

$ find . -iname \*.swp
./templates/.index.mustache.swp

$ punch .
Generating Site...

/usr/local/lib/node_modules/punch/lib/punch.js:32
    return (new self.registeredRenderers[content_type]); 
            ^
TypeError: undefined is not a function
    at Object.rendererFor (/usr/local/lib/node_modules/punch/lib/punch.js:32:13)
    at Object.fetchAndRender (/usr/local/lib/node_modules/punch/lib/punch.js:258:25)
    at /usr/local/lib/node_modules/punch/lib/punch.js:348:20
    at Array.forEach (native)
    at Object.oncomplete (/usr/local/lib/node_modules/punch/lib/punch.js:344:15)

from punch.

laktek avatar laktek commented on July 18, 2024

Hi John,

Thanks for the detailed ticket on the issue. I posted a fix to solve this issue. If you upgrade Punch (0.1.3) from NPM it should contain the fix.

However, please note still the .swp files are being copied to the output directory. You may avoid them from publishing by adding them to the .gitignore file (assuming you are using a SCM to publish your site) or use a bash script to prune them from the output directory.

from punch.

johnvh avatar johnvh commented on July 18, 2024

Thanks for the quick turnaround!

from punch.

Related Issues (20)

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.