Coder Social home page Coder Social logo

marcosbozzani / node-sass Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sass/node-sass

33.0 33.0 78.0 15.9 MB

ready to use patch here: https://github.com/marcosbozzani/patch-node-sass-watch

Home Page: https://github.com/marcosbozzani/patch-node-sass-watch

License: MIT License

JavaScript 12.80% Python 0.34% C++ 82.27% Makefile 0.52% M4 0.60% Ruby 0.01% C 1.51% Shell 1.75% Perl 0.21%

node-sass's People

Contributors

akiran avatar am11 avatar andrew avatar arian avatar blopker avatar bwilkins avatar deanmao avatar deepak1556 avatar dotzero avatar gonghao avatar hamptonmakes avatar jakobo avatar jhnns avatar keithamus avatar kevva avatar kkoopa avatar larsimmisch avatar laurentgoderre avatar marcosbozzani avatar mgol avatar msokk avatar nschonni avatar qulogic avatar rvagg avatar samccone avatar saper avatar sindresorhus avatar stefanpenner avatar xhmikosr avatar xzyfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-sass's Issues

"message": "Internal Error: File to read not found or unreadable error...

  • NPM version (6.14.7):
  • Node version (12.16.2):
  • Node Process (`
    {
  node: '12.16.2',
  v8: '7.8.279.23-node.34',
  uv: '1.34.2',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.40.0',
  napi: '5',
  llhttp: '2.0.4',
  http_parser: '2.9.3',
  openssl: '1.1.1e',
  cldr: '36.0',
  icu: '65.1',
  tz: '2019c',
  unicode: '12.1'

}
`):

  • Node Platform (win 32):
  • Node architecture (x64):
  • node-sass version (````
    node-sass 4.14.1 (Wrapper) [JavaScript]
    libsass 3.5.5 (Sass Compiler) [C/C++]
- npm node-sass versions (`[email protected]`):

here is a link to my repo  **https://github.com/umakanth-pendyala/Portfolio.git**
And please do specify any other libraries I can use instead of node-sass and if possible provide the documentation links for them.

I have updated the render.js file as you mentioned earlier

```
/*!
 * node-sass: lib/render.js
 */

var chalk = require('chalk'),
  fs = require('fs'),
  mkdirp = require('mkdirp'),
  path = require('path'),
  sass = require('./');

/**
 * Render
 *
 * @param {Object} options
 * @param {Object} emitter
 * @api public
 */

module.exports = function(options, emitter) {
  var renderOptions = {
    includePaths: options.includePath,
    omitSourceMapUrl: options.omitSourceMapUrl,
    indentedSyntax: options.indentedSyntax,
    outFile: options.dest,
    outputStyle: options.outputStyle,
    precision: options.precision,
    sourceComments: options.sourceComments,
    sourceMapEmbed: options.sourceMapEmbed,
    sourceMapContents: options.sourceMapContents,
    sourceMap: options.sourceMap,
    sourceMapRoot: options.sourceMapRoot,
    importer: options.importer,
    functions: options.functions,
    indentWidth: options.indentWidth,
    indentType: options.indentType,
    linefeed: options.linefeed
  };

  if (options.data) {
    renderOptions.data = options.data;
  } else if (options.src) {
    renderOptions.file = options.src;
  }

  var retries = 0;
  var sourceMap = options.sourceMap;
  var destination = options.dest;
  var stdin = options.stdin;

  var success = function(result) {
    retries = 0;
    var todo = 1;
    var done = function() {
      if (--todo <= 0) {
        emitter.emit('done');
      }
    };

    if (!destination || stdin) {
      emitter.emit('log', result.css.toString());

      if (sourceMap && !options.sourceMapEmbed) {
        emitter.emit('log', result.map.toString());
      }

      return done();
    }

    emitter.emit('info', chalk.green('Rendering Complete, saving .css file...'));

    mkdirp(path.dirname(destination), function(err) {
      if (err) {
        return emitter.emit('error', chalk.red(err));
      }

      fs.writeFile(destination, result.css.toString(), function(err) {
        if (err) {
          return emitter.emit('error', chalk.red(err));
        }

        emitter.emit('info', chalk.green('Wrote CSS to ' + destination));
        emitter.emit('write', err, destination, result.css.toString());
        done();
      });
    });

    if (sourceMap) {
      todo++;

      mkdirp(path.dirname(sourceMap), function(err) {
        if (err) {
          return emitter.emit('error', chalk.red(err));
        }
        fs.writeFile(sourceMap, result.map, function(err) {
          if (err) {
            return emitter.emit('error', chalk.red('Error' + err));
          }

          emitter.emit('info', chalk.green('Wrote Source Map to ' + sourceMap));
          emitter.emit('write-source-map', err, sourceMap, result.map);
          done();
        });
      });
    }

    emitter.emit('render', result.css.toString());
  };

  var error = function(error) {
    // emitter.emit('error', chalk.red(JSON.stringify(error, null, 2)));
    // code added here *********************
       if (isFileUnreadable(error) && retries < 1000) {
      retries++;
      sass.render(renderOptions, renderCallback);
    }
    else {
      emitter.emit('error', chalk.red(JSON.stringify(error, null, 2)));
    }
  };

  var isFileUnreadable = function(error) {
    var unreadable = typeof error.message === 'string' &&
    (
        error.message.startsWith('File to read not found or unreadable: ') ||
        error.message.startsWith('File to import not found or unreadable: ')
    );

    if (unreadable) {
      var file = error.message.split('not found or unreadable: ')[1].trim();
      return fs.existsSync(file);
    }

    return false;


    // ************************************
  };

  var renderCallback = function(err, result) {
    if (err) {
      error(err);
    }
    else {
      success(result);
    }
  };

  sass.render(renderOptions, renderCallback);
};
```

Still getting this error when I save the file

```
{
  "status": 3,
  "message": "Internal Error: File to read not found or unreadable: D:/WEB Deveble: D:/WEB Deve Html and css practice/My Portfolio/scss/main.scember",
  "formatted": "Internal Error: File to read not found or unreadable: D:/WEB Deveble: D:/WEB Deve Html and css practice/My Portfolio/scss/main.soli\n"
}
```
`





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.