Foundation for Emails won't compile for production - SCSS folder not being created - zurb-foundation

This is my first project with Foundation for Emails. When I run foundation build, I get:
[17:42:43] Starting 'inline'...
Unhandled rejection Error: ENOENT: no such file or directory, open 'D:\Repositories\email-template\dist\assets\scss'
at Error (native)
[17:42:44] The following tasks did not complete: default, build, inline
[17:42:44] Did you forget to signal async completion?
It looks like it's failing because the SCSS folder is not being generated.
Everything works fine when I run foundation watch.
How can I troubleshoot this further and learn why the SCSS folder isn't being created?
This is on a Windows machine, through Powershell. I've tried commenting out all of my custom SCSS code, leaving only the three #import statements at the top of app.scss. I've also tried deleting my node_modules folder and reinstalling.

Fixed it. The problem was that I had this line at the top of my HTML:
<link rel="stylesheet" href="assets/scss">

Related

Django CompileError: File to import not found or unreadable: bootstrap-sass/assets/stylesheets/bootstrap/variables

I am currently working on the cadasta - an open source organisation's - Django project.
They require you to run their platform in a virtual machine (virtualbox) using vagrant.
As I enter their repository, and run their server using ./runserver, I am all of a sudden getting a CompileError which says:
File to import not found or unreadable: bootstrap-sass/assets/stylesheets/bootstrap/variables. Parent style sheet: /vagrant/cadasta/core/static/css/_variables.scss.
on line 74 of core/static/css/_variables.scss
#import "bootstrap-sass/assets/stylesheets/bootstrap/variables";
Following this link: https://github.com/jrief/djangocms-cascade/issues/130,
I found that libsass is already installed, and so I tried installing bootstrap-sass inside the VM, but it did no good. Everything was working fine until I renamed the cadasta-platform directory (i.e their github repo that I cloned, and so the main project is included inside this folder only.) and refreshed. I even tried running the server again, but couldn't get through this error. I suppose renaming the directory shouldn't be the cause?
I have no clue on how to proceed. Please help.
EDIT: After renaming the project folder to the same name solved this error. If anyone would ever like to answer this question, please explain why renaming the project directory produces an error like this? As I believe, I think renaming should not be an issue?

ember electron:package build failed, caused by ember-browserify

when I want to build my ember electron app with ember electron:package
I always get the error:
Build failed.
File: assets/vendor.js (91129:6)
The Broccoli Plugin: [UglifyWriter] failed with:
followed by several lines of "Error at...:" (always within node_modules)
I could figure out that it must have something to do with ember-browserify.
I am importing this node module in a service.js file:
import Usabilla from 'npm:usabilla-api';
The curious thing is, that with ember electron (like ember serve) everything is fine and I can use the node module without any errors. Issues only occur when I want to package the app to the .dmg and exe files for distribution.
What am I missing ?
Thanks for any help or hints!
Your build is failing on the minification step. Possibly because of the size of one of the packages you're pulling in or because it's already been minified. Minification only happens when you're building for production or packaging which is why you're not seeing the issue when you run locally.
From the EmberCLI docs on minification, where you'll find more on the minifaction step:
the js-files are minified with broccoli-uglify-js in the production-env by default. You can pass custom options to the minifier via the minifyJS:options object in your ember-cli-build
You can exclude specific files/resources that are causing problems:
To exclude assets from dist/assets from being minificated, one can pass options for broccoli-uglify-sourcemap
I just create the demo app in c drive and it's working perfectly.

How can I run unittests in Dart Editor?

I have the web application project in Dart Editor and I want to write some unittests for it. I tried to create .dart file with a simple unit test in the same project (with main function etc) but in context menu I had only 'run as javascript' and 'run in dartium' options (when I click any of them nothing happens). How can I run unittest as console app from Dart Editor? What is the most convenient way of doing such tests?
I had exactly the same problem. I wanted to unit test the behaviour of my widgets (from the dart editor v1.3.3) having mocked out the UI elements, but found that, because I was importing dart:html, I was forced to run the tests as if they were a web app with one of the 'Run in browser' menu options.
It seems that as soon as you import dart:html or a package that does so you're stuck with the 'Run in browser' options for your unit tests (creating another package to test the original one doesn't solve the problem either, for the same reason, it has to import the dart:html one). And yes, attempting to run regular unit tests with the 'Run in browser' options just fails silently and does absolutely nothing.
The simple solution is to use an html file to run your tests. You can adapt your unit tests to output to the webpage if you like but it's not essential.
test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unit Test Results</title>
</head>
<body>
<script type="application/dart" src="test.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
test.dart
// Used to illustrate the problem. Importing dart:html causes
// the context menu to show only the 'Run in browser' options.
import 'dart:html';
import 'package:unittest/unittest.dart';
// Required if you want to use useHtmlConfiguration().
import 'package:unittest/html_config.dart';
void main() {
// Required if you want to output the unit test results
// to the HTML page rather than the console.
useHtmlConfiguration();
test ('simple test', () => expect(true, isTrue, reason:"true isn't true"));
}
I actually had the exact same problem as described in the question. After some searching I discovered my directory structure was incorrect.
my directory structure was as follows:
/projectname
/web
index.html
main.dart
/test
test_file.dart
This is wrong. I changed my directory structure to the following:
/projectname
/web
index.html
main.dart
/test
test_file.dart
As you can see, i moved the /test directory out of the /web directory. As soon as I did this, I was now able to right click the test_file.dart file and select 'run' in the context menu (not 'run as javascript' or 'run in dartium') and see the tests being run in the built-in console in the dart editor.
For more information: the full pub package layout conventions can be found here: https://www.dartlang.org/tools/pub/package-layout.html
information about unit tests in dart can be found here: https://www.dartlang.org/articles/dart-unit-tests/#configuring-the-test-environment (including configuring the test environment for stuff like html output etc...)
You say you have a web application project so you want test code that runs in the browser?
I have never experienced that I have run as javascript or run in Dartium for console applications. Did you import 'dart:html' in this dart file?
Anyways maybe this answers your question:
You can run unittests testing web code with content_shell.
The Dart installation directory contains a script to download content_shell (it is not part of the Dart installation package to keep it small).
You actually run an HTML page:
content_shell --dump-render-tree polymer_ajax.html
I haven't tried but when you build your test code to JavaScript using
pub build test
you should be able to run the result using content_shell.
DartEditor doesn't show a run option for a bash script (just tried) so you would need to build a Dart script that invodes content_shell.
The Dart team has mentioned several times recently that they want to improve the test story but the infrastructure for run/build is still work in progress. When this has settled I guess the test support will be worked on next.
Ok, I will describe solution that works best for me.
I created separate project for tests in Dart Editor (polymer web application - the same as target project). Main .html file in test project imports .dart file that looks like:
library foo_test;
import '../../foo_project/web/foo.dart'; //test target
import '../packages/mock/mock.dart';
import '../packages/unittest/unittest.dart';
import '../packages/unittest/html_config.dart';
void main() {
useHtmlConfiguration();
test("sample test", () {
expect(foo_function(), equals(expected_result) );
});
}
useHtmlConfiguration() creates some nice page with all tests listed. I also tried useHtmlEnhancedConfiguration() as described in https://www.dartlang.org/articles/dart-unit-tests/ but it doesn't print stack traces (neither in page nor in console) so it is rather useless for me. There is also useHtmlInteractiveConfiguration() in documentation but it doesn't exist in unittest package.

How to use Foundation 5 with Compass+SASS?

The problem
Foundation 5 was released last week, that's great, but the new version requires to use bower for using F5 with SASS and the official documentation seems to be a bit incomplete and immature.
I'm trying to create a project using the steps proposed by the docs:
[sudo] npm install -g bower
and then
gem install foundation
No problems here. The problem is when creating a Compass project:
foundation new MY_PROJECT
cd MY_PROJECT
compass compile
After Compass compilation, I get the following error:
directory stylesheets/
error scss/app.scss (Line 1: File to import not found or unreadable: settings.
Load paths:
/home/cartucho/MY_PROJECT/scss
/var/lib/gems/1.9.1/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/var/lib/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets
/home/cartucho/MY_PROJECT/bower_components/foundation/scss
Compass::SpriteImporter)
create stylesheets/app.css
Compass config file (config.rb):
# Require any additional compass plugins here.
add_import_path "bower_components/foundation/scss"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascripts"
The SASS file (app.sass):
#import "settings";
#import "foundation";
...
The problem seems to be in config.rb:
add_import_path "bower_components/foundation/scss"
because Compass fail trying to import the files settings and foundation but I don't know how to fix it. Any help will be highly appreciated.
Thanks.
You need to change the line foundation new MY_PROJECT by replacing MY_PROJECT with the folder you want to install the project on. After that, confirm that these folders exist on the directory you specified above - "bower_components/foundation/scss"
When starting a project run compass init and then compass watch (in Terminal) to watch for changes on the .sass files.
Personally, I don't go that route and use http://koala-app.com/ to convert or "compile" my Sass. It's FREE and awesome.
This is SASS were talking about. Please correct me if i'm wrong but you don't need the underscore when importing an "include" file. I create separate sass files for my variables and my mix-ins. They are prefixed with and underscore which signifies an "include" file. SASS recognizes #import "variables"; as #import "_variables.scss". So to be clear when it is an include file just the name of the sass file is need not the _ or the scss extension.
I have never put an underscore before any include file that I have named _filename.scss.
There is probably another issue going on. Possibly with the install and the paths for bower. For those who did add the underscore in the past and it worked...well you just bypass what could become a deeper issue down the road. You need to check your install.
In your app.sass file change the following line
#import "settings";
To
#import "_settings";
Explaination
When you run compass watch you got the error
error scss/app.scss (Line 1: File to import not found or unreadable: settings.
This just means it can't find the settings file being imported. By adding the underscore to the settings file you have specified the correct file path. If you receive any other errors like this, make sure the file path is correct.
I think I had the same error; finally I found in the _settings.scss
You need to underscore before the importing the functions
Before:
// Uncomment to use rem-calc() in your settings
#import "foundation/functions";
After:
// Uncomment to use rem-calc() in your settings
#import "foundation/_functions";
Also you would need to import the settings same way.
In my example I made style.scss and import all the SCSS inside :
#import "foundation/_settings", "_normalize", "_foundation";
I encountered this same issue, but for me the solution was to change the import of settings in app.scss from:
#import "settings";
To:
#import "foundation/_settings";
Once you've done that, run compass watch again.
You can install Grunt into your project which uses compass's watch function and then some other clever stuff to compile your sass and livereload it in the browser! Here's a great tutorial on how to get it up and running! (it's as simple as creating two new files in the root of your project and then running a few commands from your command line! I seriously advise it!)
http://moduscreate.com/get-up-and-running-with-grunt-js/
I had the same problem.
For Ubuntu 14.04 users make sure nodejs and Bower are working properly.
You can follow these instructions here http://www.codediesel.com/javascript/installing-bower-on-ubuntu-14-04-lts/comment-page-1/#comment-63283

Error while executing django sphinx

I have installed django sphinx for my project.After successful installation and sphinx quickstart operation, i tried for creating html inside the "build" folder using the command "make html" and it gives me the error
"make: * No rule to make target `html'. Stop.".
Any help..Thanks in advance.
In for sphinx-doc (i have never used django-sphinx) it would never work to run make html inside the build folder. You need to go one folder level up so that the folders build and source ar visible. Most likely you will see the Makefile file here as well.
Try to change directories and run make html again.