Skip to content
This repository has been archived by the owner on Feb 17, 2019. It is now read-only.

Build fails under windows #37

Open
MaksimBurnin opened this issue Jan 22, 2017 · 1 comment
Open

Build fails under windows #37

MaksimBurnin opened this issue Jan 22, 2017 · 1 comment

Comments

@MaksimBurnin
Copy link

MaksimBurnin commented Jan 22, 2017

The snipet below generates an error in Windows 10:

Brocfile:

styleFiles = new BroccoliEyeglass([app.styles,imagesTree],{
  includePaths: app.sassPaths,
  cssDir: app.cssDir,
  discover: true,
  outputStyle: env == 'production' ? 'compressed' : 'nested'
});

Error:

 broccoli serve
Support for passing several trees to BroccoliSassCompiler has been removed.
Passing the trees to broccoli-merge-trees with the overwrite option set,
but you should do this yourself if you need to compile CSS files from them
or use the node-sass includePaths option if you need to import from them.
Serving on http://localhost:4200

Built with error:
Error: File to read not found or unreadable: C:/xampp/htdocs/project/tmp/eyeglass_compiler-input_base_path-bpb4bm47.tmp/C:/xampp/htdocs/project/tmp/eyeglass_compiler-input_base_path-bpb4bm47.tmp/project.scss
    at undefined:undefined:undefined
    at C:\xampp\htdocs\project\node_modules\broccoli-eyeglass\lib\broccoli_sass_compiler.js:667:11
    at Object.finallyHandler (C:\xampp\htdocs\project\node_modules\bluebird\js\main\finally.js:39:23)
    at Object.tryCatcher (C:\xampp\htdocs\project\node_modules\bluebird\js\main\util.js:26:23)
    at Promise._settlePromiseFromHandler (C:\xampp\htdocs\project\node_modules\bluebird\js\main\promise.js:510:31)
    at Promise._settlePromiseAt (C:\xampp\htdocs\project\node_modules\bluebird\js\main\promise.js:584:18)
    at Promise._settlePromises (C:\xampp\htdocs\project\node_modules\bluebird\js\main\promise.js:700:14)
    at Async._drainQueue (C:\xampp\htdocs\project\node_modules\bluebird\js\main\async.js:123:16)
    at Async._drainQueues (C:\xampp\htdocs\project\node_modules\bluebird\js\main\async.js:133:10)
    at Immediate.Async.drainQueues (C:\xampp\htdocs\project\node_modules\bluebird\js\main\async.js:15:14)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
    at processImmediate [as _immediateCallback] (timers.js:594:5)

I have tried to disable discover, but the error is still the same

styleFiles = new BroccoliEyeglass([app.styles,imagesTree],{
  includePaths: app.sassPaths,
  cssDir: app.cssDir,
  discover: false,
  sourceFiles: ['project.scss'],
  outputStyle: env == 'production' ? 'compressed' : 'nested'
});

Both versions work well in both Linux and OSX

@MaksimBurnin
Copy link
Author

So after some investigation, it looks to me that the root cause of the error is node-glob behaviour, it return values it always uses forward slash as a separator https://github.com/isaacs/node-glob#windows

The issue can be solved by using path.normalize in either filesInTree or removePathPrefix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant