SASS not compiling with the Dart DDC

Issue

I am getting the following errors when compiling my web-app with DDC:

SEVERE] build_web_compilers|ddc on package:sass/sass.dartdevc.module (cached):
Error compiling dartdevc module:sass|lib/sass.ddc.js

[error] Target of URI doesn't exist: 'node/interface.dart'. (package:sass/src/importer/node.dart, line 5, col 8)
[error] The exported library ''node/interface.dart'' can't have a part-of directive. (package:sass/src/importer/node.dart, line 5, col 8)
[error] Target of URI doesn't exist: 'io/interface.dart'. (package:sass/src/io.dart, line 7, col 8)
[error] Target of URI doesn't exist: 'io/interface.dart'. (package:sass/src/io.dart, line 12, col 8)
[error] The exported library ''io/interface.dart'' can't have a part-of directive. (package:sass/src/io.dart, line 12, col 8)
[error] Target of URI doesn't exist: 'package:package_resolver/package_resolver.dart'. (package:sass/src/sync_package_resolver.dart, line 1, col 8)

Im not really sure what I need. I have a dart file named compiler-sass.dart with the following code:

import 'dart:io';
import 'package:sass/sass.dart' as sass;

void main(List<String> arguments) {
  var result = sass.compile(arguments[0]);
  new File(arguments[1]).writeAsStringSync(result);
}

If I manually compile my sass files it works but not with the command:

webdev serve --hot-reload

My pubspec has the following dependencies:

dependencies:
  path: ^1.4.1
  sass: ^1.16.1
  vue: ^0.4.1
  build_runner: ^1.1.2
  build_web_compilers: ^1.0.0
  intl: ^0.15.7

What am I missing here? Why doesnt it work?

Solution

https://pub.dartlang.org/packages/sass_builder integrates directly with webdev to incrementally only build what changed and what the browser fetches.

Answered By – Günter Zöchbauer

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *