Site is built with the following pre-commit hook.
BROCCOLI_TACO_ENV=production broccoli-taco build dist
cp -rf ./dist/* ./
git add .
Static Sites Powered by Broccoli
Home Page: http://broccoli-taco.com/
Site is built with the following pre-commit hook.
BROCCOLI_TACO_ENV=production broccoli-taco build dist
cp -rf ./dist/* ./
git add .
Can't test the app.
1) broccoli-taco build <destination> Basic site "before all" hook:
Error: Command failed:
TypeError: undefined is not a function
at null.<anonymous> (/home/ivan/programming/broccoli-taco/lib/site.js:105:15)
After implementing some basic dynamic pages, like this:
// site/pages/category/data.js
module.exports = function() {
return [
{
"title": "This is title",
"body": "This is content",
"filename": "category/foo"
},
{
"title": "This is another title",
"body": "This is content",
"filename": "category/bar"
}
]
};
i've restarted broccoli-taco serve
and now it keeps failing with the Error: Path or pattern "**/*.html" did not match any files
Here is what what i get in the console:
MBP-dddm:static-site ddddm$ broccoli-taco serve
Serving on http://localhost:4200
Built with error:
Error: Path or pattern "**/*.html" did not match any files
at Object.multiGlob (/Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/broccoli-kitchen-sink-helpers/index.js:202:13)
at /Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/broccoli-static-compiler/index.js:28:27
at lib$rsvp$$internal$$tryCatch (/Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/rsvp/dist/rsvp.js:489:16)
at lib$rsvp$$internal$$invokeCallback (/Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/rsvp/dist/rsvp.js:501:17)
at lib$rsvp$$internal$$publish (/Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/rsvp/dist/rsvp.js:472:11)
at Object.lib$rsvp$asap$$flush [as _onImmediate] (/Users/ddddm/Documents/static-site/node_modules/broccoli-taco/node_modules/rsvp/dist/rsvp.js:1290:9)
at processImmediate [as _immediateCallback] (timers.js:336:15)
I ran into two problems with writing my own helpers in ./helpers
.
First of all I would like to overwrite the helpers in Broccoli Taco. This line is preventing me from it. I would much rather have the helpers from Broccoli Taco be defaults that I can overwrite if I wanted to. I understand you want to enforce a consistent API and functionality but I believe that when users helpers are not overwriting the "built-in" ones users get confused, like me :)
It is not that big of a deal naming my helpers something else, I just thought I would ask to see if you would be willing to change it.
Secondly, I cannot see that it is documented anywhere that to make any helpers, that return HTML, work properly with Handlebars.SafeString
you have to use var Handlebars = require('broccoli-taco/node_modules/handlebars')
. Otherwise you end up with your own instance of Handlebars
and Handlebars.SafeString
that will not match the one used inside Broccoli Taco.
I guess there is an instanceof
check or similar inside Handlebars for the SafeString mechanism that makes an instance of Handlebars.SafeString
from one Handlebars instance not work with another.
I doubt think could be improved but at least it could be documented better to save other people the time I put in to find the cause. So either use var Handlebars = require('broccoli-taco/node_modules/handlebars')
or "triple-stash" ({{{my-helper}}}
) for helpers created by users, both will work.
I'm trying to import a scss file which in turn imports a google font as below
@import 'https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin';
broccoli-taco serve tries to open this file and throws exception
Is it an issue or am i doing something wrong
For example:
$ broccoli-taco serve
And then:
$ mkdir -p site/pages/about/
$ echo "{{#layout}}About{{/layout}}" > site/pages/about/index.hbs
$ echo "body { background: red;}" > site/pages/about/page.scss
$ echo "console.log('about');" > site/pages/about/page.js
The /about
page is created, but the page.scss
and page.js
are not processed until the server is restarted.
Additionally, deleting a page's folder causes the server to die in an non-elegant way:
$ rm -rf site/pages/about/
If you export an array of data from site/pages/data.js, the resulting pages are create in the wrong tmp directory, and then are not ever merged into the site.
A simple bugfix that works in my case is changing
lib/broccoli-taco-handlebars.js:57
from dirname.substring(0, dirname.lastIndexOf('/'))
to dirname
That said, I presume the substring stuff is in there for a reason, so something a bit more complicated might be needed.
Otherwise BT is pretty cool :)
I was following the tutorial and had issues on the "npm install" step [1]. I searched around and it looks like the issue is some kind of incompatibility between old versions of "node-sass" and new versions of Node.js. I updated the dependency versions in "package.json" to the latest available (as of today) and "npm install" worked.
Based on the stuff I found online, a bunch of people will probably have this issue. How about updating the package.json to the latest? Mine currently looks like:
"dependencies": {
"broccoli-base64-css": "^0.0.6",
"broccoli-browserify": "^0.1.0",
"broccoli-clean-css": "^1.1.0",
"broccoli-fingerprint": "0.0.4",
"broccoli-sass": "^0.7.0",
"broccoli-uglify-js": "^0.1.3",
"broccoli-taco": "0.0.8"
}
[1] The error I got on "npm install"
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
> [email protected] install /Users/kannan/Develop/gift-website/node_modules/node-sass
> node build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
CXX(target) Release/obj.target/binding/binding.o
In file included from ../binding.cpp:1:
../../nan/nan.h:337:54: error: too many arguments to function call, expected at most 2, have 4
return v8::Signature::New(nan_isolate, receiver, argc, argv);
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:4674:3: note: 'New' declared here
static Local<Signature> New(
^
In file included from ../binding.cpp:1:
../../nan/nan.h:409:19: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean 'ExternalStringResource'?
v8::String::ExternalAsciiStringResource *resource) {
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ExternalStringResource
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:2207:19: note: 'ExternalStringResource' declared here
class V8_EXPORT ExternalStringResource
^
In file included from ../binding.cpp:1:
../../nan/nan.h:408:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::String> NanNew(
^
../../nan/nan.h:403:36: note: previous definition is here
NAN_INLINE v8::Local<v8::String> NanNew(
^
../../nan/nan.h:427:3: error: redefinition of 'NanNew'
NanNew<v8::StringObject, v8::Handle<v8::String> >(
^
../../nan/nan.h:420:3: note: previous definition is here
NanNew<v8::StringObject, v8::Local<v8::String> >(
^
../../nan/nan.h:444:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:438:36: note: previous definition is here
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:456:36: error: redefinition of 'NanNew'
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:450:36: note: previous definition is here
NAN_INLINE v8::Local<v8::RegExp> NanNew(
^
../../nan/nan.h:767:13: error: no member named 'smalloc' in namespace 'node'
, node::smalloc::FreeCallback callback
~~~~~~^
../../nan/nan.h:777:12: error: no matching function for call to 'New'
return node::Buffer::New(nan_isolate, data, size);
^~~~~~~~~~~~~~~~~
/Users/kannan/.node-gyp/5.7.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from
'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/Users/kannan/.node-gyp/5.7.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument ('const char *')
would lose const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/Users/kannan/.node-gyp/5.7.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 3
were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
^
/Users/kannan/.node-gyp/5.7.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 3
were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
In file included from ../binding.cpp:1:
../../nan/nan.h:781:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
return node::Buffer::New(nan_isolate, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no
known conversion from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' for 1st argument
class Local {
^
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no
known conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&' for 1st argument
class Local {
^
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against
'MaybeLocal'
V8_INLINE Local(Local<S> that)
^
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against
'v8::MaybeLocal<v8::Object>'
V8_INLINE Local(S* that)
^
In file included from ../binding.cpp:1:
../../nan/nan.h:788:26: error: no member named 'Use' in namespace 'node::Buffer'
return node::Buffer::Use(nan_isolate, data, size);
~~~~~~~~~~~~~~^
../../nan/nan.h:1728:12: error: no member named 'IsExternalAscii' in 'v8::String'; did you mean 'IsExternal'?
if (str->IsExternalAscii()) {
^~~~~~~~~~~~~~~
IsExternal
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:2171:8: note: 'IsExternal' declared here
bool IsExternal() const;
^
In file included from ../binding.cpp:1:
../../nan/nan.h:1729:23: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean
'ExternalStringResource'?
const v8::String::ExternalAsciiStringResource* ext;
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ExternalStringResource
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:2207:19: note: 'ExternalStringResource' declared here
class V8_EXPORT ExternalStringResource
^
In file included from ../binding.cpp:1:
../../nan/nan.h:1730:16: error: no member named 'GetExternalAsciiStringResource' in 'v8::String'; did you mean
'GetExternalOneByteStringResource'?
ext = str->GetExternalAsciiStringResource();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GetExternalOneByteStringResource
/Users/kannan/.node-gyp/5.7.0/include/node/v8.h:2274:40: note: 'GetExternalOneByteStringResource' declared here
const ExternalOneByteStringResource* GetExternalOneByteStringResource() const;
^
In file included from ../binding.cpp:1:
../../nan/nan.h:1730:9: error: assigning to 'const v8::String::ExternalStringResource *' from incompatible type 'const
v8::String::ExternalOneByteStringResource *'
ext = str->GetExternalAsciiStringResource();
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../nan/nan.h:1731:11: error: assigning to 'const char *' from incompatible type 'const uint16_t *'
(aka 'const unsigned short *')
*data = ext->data();
^ ~~~~~~~~~~~
../binding.cpp:124:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
node::FatalException(try_catch);
^
/Users/kannan/.node-gyp/5.7.0/include/node/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated here
inline void FatalException(const v8::TryCatch& try_catch) {
^
/Users/kannan/.node-gyp/5.7.0/include/node/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
1 warning and 15 errors generated.
make: *** [Release/obj.target/binding/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/Cellar/node/5.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kannan/Develop/gift-website/node_modules/node-sass
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
Build failed
Using data.json
files does not update via live reload properly. You have to restart the server.
Is this intended behavior?
How to reproduce
broccoli-taco new my-site
cd my-site && npm install
mv site/pages/data.js site/pages/data.json
echo "{\"title\":\"Hello\"}" > site/pages/data.json
broccoli-taco serve
site/pages/data.json
.Expected result: The title should update via live reload to the changed value in data.json
files.
Actual result: The title does not update in the browser even though the terminal shows that it identified the change, the live reload appears to do its thing and a refresh does occur. But the title does not update. I'm using Chrome with this LiveReload plugin
Using data.js
does update the title properly. This issue only happens with JSON files.
Hey,
I immediately fell in love with this ssg, but I miss the coffeescript support. Any chance to get this?
BR toovy
Curious how best to kill the server listening on 4200? Same goes for the livereload server?
Hi moudy, I'm writing an article about how to set up broccoli-taco with GitHub and hosted with Netlify, but I'm having a problem after running the command: npm install
It throws three warning, which I believe is what's causing the multitude of errors that come after these.
Iv'e found these warnings elsewhere too (google), but I'm not sure how to get past them ?
npm WARN deprecated [email protected]: use serve-favicon module
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.
npm WARN deprecated [email protected]: This package is no longer maintained. See its readme for upgrade details.
I got rid of the top and bottom warning, but not the middle warning. I did this by using the following commands, though I've got no clue why or which one did the tricks:
$ npm i --save lodash
$ sudo -H npm i -g npm
$ npm i lodash-migrate
However, I'm still getting that one error and I was wondering if you could help me out here?
There'll be a very positive article about your work as a reward :)
Hello again!
Trying to write a helper that allows me to access partials dynamically. I'd like to access Handlebars.partials[]
but broccoli-taco
tells me ReferenceError: Handlebars is not defined
. Is there a method in which I can access the Handlebars object?
fs.js:1063
throw errnoException(process._errno, 'watch');
^
Error: watch ENOENT
at errnoException (fs.js:1031:11)
at FSWatcher.start (fs.js:1063:11)
at Object.fs.watch (fs.js:1088:11)
at Watcher.watchdir (/home/ivan/programming/givanse-broccoli-taco-branch/node_modules/broccoli-taco/node_modules/broccoli-sane-watcher/node_modules/sane/index.js:198:20)
at Watcher.<anonymous> (/home/ivan/programming/givanse-broccoli-taco-branch/node_modules/broccoli-taco/node_modules/broccoli-sane-watcher/node_modules/sane/index.js:326:14)
at Object.oncomplete (fs.js:108:15)
Haven't been able to reproduce it reliably.
The project folder created by
broccoli-taco new my-site
Doesn't have a .gitignore
file and the one in the repo has to be copied manually.
I'm trying out the broccoli-taco, but I'm getting an error when running broccoli-taco serve
. I'm using node v0.12.2, but when I run broccoli-taco serve it throws a TypeError at me - this is the output:
Serving on http://localhost:4200
Built with error:
TypeError: Arguments to path.join must be strings
at Object.posix.join (path.js:488:13)
at Fingerprint.getDestFilePath (/home/jimmi/Sites/broccoli-taco-demo/node_modules/broccoli-fingerprint/index.js:43:23)
at Fingerprint.Filter.canProcessFile (/home/jimmi/Sites/broccoli-taco-demo/node_modules/broccoli-filter/index.js:58:15)
at /home/jimmi/Sites/broccoli-taco-demo/node_modules/broccoli-filter/index.js:42:18
at /home/jimmi/Sites/broccoli-taco-demo/node_modules/promise-map-series/index.js:11:14
at lib$rsvp$$internal$$tryCatch (/home/jimmi/Sites/broccoli-taco-demo/node_modules/rsvp/dist/rsvp.js:493:16)
at lib$rsvp$$internal$$invokeCallback (/home/jimmi/Sites/broccoli-taco-demo/node_modules/rsvp/dist/rsvp.js:505:17)
at /home/jimmi/Sites/broccoli-taco-demo/node_modules/rsvp/dist/rsvp.js:1001:13
at lib$rsvp$asap$$flush (/home/jimmi/Sites/broccoli-taco-demo/node_modules/rsvp/dist/rsvp.js:1198:9)
at process._tickCallback (node.js:355:11)
I sincerely hope someone can give me an idea of the problem I'm facing here...
node_modules/broccoli-browserify/node_modules/browserify/index.js:0
(function (exports, require, module, __filename, __dirname) { var crypto = req
^
RangeError: Maximum call stack size exceeded
That error appears if I:
// Brocfile.js
var funnel = require('broccoli-funnel');
var fontelloFonts = funnel('assets/fontello/font/', {
files : ['fontello.woff',
'fontello.ttf'],
destDir : '/font'
});
var Site = require('broccoli-taco');
var site = new Site();
var appTree = site.toTree();
module.exports = mergeTrees([appTree, fontelloFonts]);
I did rm -rf node_modules/ && npm install
and it seems to be solved, but sometimes it will show up again.
I experimented with node 0.10 and 0.12, but I couldn't find any steps that will reproduce consistently.
So, for now I'm just documenting what I saw.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.