Import SCSS files from outside project structure


#1

I have an ember-cli app inside another non ember project directory. I’m trying to import a SCSS file from that non-ember project. I’ve tried to just @import '..path..'; directly in the app.scss file and that didnt work. Then I tried the following in my Brocfile:

/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var compileSass = require('broccoli-sass');

var app = new EmberApp();

var sassImportPaths = [
  'app/styles',
  '../app/sass'
];

var appCss = compileSass(sassImportPaths, 'app.scss', '/assets/app.css');
var outsideMNCss = compileSass(sassImportPaths, 'outside.scss', '/assets/outside.css');

module.exports = app.toTree([appCss, outsideMNCss]);

In both cases I get the following type of error:

{
"status": 1,
"file": "/Users/jdillon/Documents/.../app/sass/outside.scss",
"line": 1,
"column": 9,
"message": "file to import not found or unreadable: compass/css3\nCurrent dir: /Users/jdillon/Documents/.../app/sass/"
} [string exception]

The path in both cases is accurate. Is there something preventing me from importing files outside of the project structure?


#2

The plot thickens. I noticed this watchman error:

FSEventStreamStart failed
Error: FSEventStreamStart failed
at null.<anonymous> (/Users/jdillon/Documents/WorkBarkley/Clients/pedal_mn/pedal_mn/src/coding/redesign     2013/map/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/node_modules/fb-    watchman/index.js:84:23)
    at emit (events.js:95:17)
    at null.<anonymous> (_stream_readable.js:764:14)
    at emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:426:10)
    at emitReadable (_stream_readable.js:422:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Readable.push (_stream_readable.js:127:10)
    at Transform.push (_stream_transform.js:140:32)
    at JSONStream._transform (/Users/jdillon/Documents/WorkBarkley/Clients/pedal_mn/pedal_mn/src/coding/redesign 2013/map/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/node_modules/fb-watchman/node_modules/json-stream/lib/json-stream.js:30:14)

#3

I ended up switching over to ember-cli-compass-compiler and things worked as expected without any Brocfile shenanigans. I just @import... it in my main scss file.

However I’m getting some errors before I start the server. One for watchman, the other I think for symlink-or-copy (at least thats where the stack trace terminates). The errors are reproduced below:

(FYI: I shortened some of the path names that would give away a bit about my client. From app on though its original)

The error when I start the server:

FSEventStreamStart failed
Error: FSEventStreamStart failed
at null.<anonymous> (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/node_modules/fb-watchman/index.js:84:23)
    at emit (events.js:95:17)
    at null.<anonymous> (_stream_readable.js:764:14)
    at emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:426:10)
    at emitReadable (_stream_readable.js:422:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Readable.push (_stream_readable.js:127:10)
    at Transform.push (_stream_transform.js:140:32)
    at JSONStream._transform (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/node_modules/fb-watchman/node_modules/json-stream/lib/json-stream.js:30:14) 

When I make a file change:

EEXIST, file already exists '/Users/jdillon/Documents/.../app/tmp/class-tmp_cache_dir-SjogQwVL.tmp'
Error: EEXIST, file already exists '/Users/jdillon/Documents/.../app/tmp/class-tmp_cache_dir-SjogQwVL.tmp'
    at Object.fs.symlinkSync (fs.js:741:18)
    at symlink (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
    at Function.symlinkOrCopySync [as sync] (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at /Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
    at lib$rsvp$$internal$$tryCatch (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
    at lib$rsvp$$internal$$publish (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
    at Object.lib$rsvp$asap$$flush [as _onImmediate] (/Users/jdillon/Documents/.../app/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
    at processImmediate [as _immediateCallback] (timers.js:345:15)

#4

FYI: logging out of my account on my computer fixes the watchman issue. But the symlink issue still prevents live reloading or any features that accompany it.