How do I compile dart sass using flutter in vscode - flutter

I have been using vscode with dart sass and flutter, however after my most recent update I am having trouble compiling my dart sass.
Here is the code that was working before:
import 'dart.io';
import 'package:sass/sass.dart' as sass;
id main(List<String> arguments) {
var result = sass.compile(arguments[0]);
new File(arguments[1]).writeAsStringSync(result);
}
As mentioned this was working, however I now get a error come up saying:
'compile' is deprecated and shouldn't be used. Use compileToResult() instead...
I have tried to find a solution but have had no luck. Any help would be greatly appreciated

Related

A constructor from a node module I'm importing works when using Create React App, but errors in ParcelJS. What is going on?

I'm converting a project that was built using Create React App to use ParcelJS as a bundler instead. Strangely, a dependency that I imported during development (#twilio/voice-sdk) works fine in the CRA version of the application, but I get the following error when I try to invoke the constructor in the Parcel version:
TypeError: (this._options.AudioHelper || audiohelper_1.default) is not a constructor
The package is identical between both (#v2.1.1, the latest). I'm importing using ESM syntax, so:
import { Device } from '#twilio/voice-sdk'
I trying using CommonJS syntax (require) and it still didn't work. I've dug into the compiled code, and that seems to be the issue. I imagine there are a lot of differences, but one that I've noticed is here:
On the left is the code compiled by Create React App, which does seem to be exporting something more substantial than on the left - is the export just an empty object? If so, it's no wonder I'm getting a constructor error.
Unfortunately, no amount of googling and SO sleuthing has clarified what I could do to make ParcelJS transpile this dependency properly, if that's the issue. I've tried to make the babel config for ParcelJS match CRA more closely by adding the following to a babel.config.json
{
"plugins": [
"#babel/plugin-transform-modules-commonjs"
]
}
But no luck. Any ideas from where to go from here, or is it time to switch to Webpack?
It looks like Twilio package has a problem when using Parcel 2: https://github.com/twilio/twilio-voice.js/issues/101

Can't run Flutter web on Chrome Device with BluetoothThermalPrinter package

Can't run my flutter web app when blue_thermal_printer package is being used.
Compiler show these errors:
import 'package:blue_thermal_printer/';
^
/D:/All%20Data/Softwares/Latest%20Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/blue_thermal_printer-1.1.8/lib/blue_thermal_printer.dart:189:23:
Error: Type 'Registrar' not found.
static registerWith(Registrar value){
^^^^^^^^^
lib/generated_plugin_registrant.dart:31:3: Error: Getter not found: 'BlueThermalPrinterPlugin'.
BlueThermalPrinterPlugin.registerWith(registrar);
What I have tried until now:
1- Tried to enable flutter web support with this command: flutter create .
2- Tried to create a new class BlueThermalPrinterPlugin in the package file blue_thermal_printer.dart with the following method:
class BlueThermalPrinterPlugin{
static var nameoo ;
static registerWith(Registrar value){
this.nameoo=value;
return nameoo;
}
}
But that doesn't either helps because sdk generated automatic generated_plugin_registrant.dart which produces incomplete import i.e import 'package:blue_thermal_printer/'; causing compile time issue.
I need to run my flutter app on web which was working fine a few days before.
Thanks to the developer of this package whom I contacted personally and he corrected the error in packge. blue_thermal_printer 1.2.0 is working fine and doesn't contain this error anymore.

Import miniSerializeError from redux-toolkit

I am trying to import the miniSerializeError function from redux toolkit. To me it looks like the function is exported in: https://github.com/reduxjs/redux-toolkit/blob/4ad8be674187c2122b2fd0d499c61ab77cfec072/src/index.ts#L123 but i cant find the function in the build.
Does anyone know it this is a bug or the function just is not exported?
Link to the function: https://github.com/reduxjs/redux-toolkit/blob/4ad8be674187c2122b2fd0d499c61ab77cfec072/src/createAsyncThunk.ts#L57
Upgraded to recent most version (1.6.1) of redux-toolkit and it worked.
miniSerializeError is exported from version 1.6.0.
So make sure of the version of redux-toolkit in your package.json

myfatoorah_flutter import package fails build

I have added myfatoorah_flutter package version 1.0.7 and in file I have imported the package as import 'package:myfatoorah_flutter/myfatoorah_flutter.dart'; it fails the build and gives the following error
../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/myfatoorah_flutter-1.0.7/lib/myfatoorah_flutter.dart:609:31: Error: The argument type 'bool Function(bool)' can't be assigned to the parameter type 'bool Function(bool, RouteInfo)'.
- 'RouteInfo' is from 'package:back_button_interceptor/src/back_button_interceptor.dart'
('../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-4.3.1/lib/src/back_button_interceptor.dart').
BackButtonInterceptor.add(myInterceptor);
I have tried following solutions and none of them worked:
changed version of myfatoorah_flutter
switched between channels dev/stable
upgraded flutter sdk
settings.gradle removed and added again
when I remove import line, it works fine, help is required so that I can integrate the payment methods
I am also getting the same error as I tried this way and worked for me.
change version of back_button_interceptor to back_button_interceptor: 4.0.2 in myfatoorah_flutter's pubspec.ymal.

Failed to minify the code ./node_modules/#material-ui/core/es/styles/createMuiTheme.js

Hey i i am working with the latest version of material UI, i have a problem when i am trying to create build (react-scripts build).
this is the error that i got:
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/#material-ui/core/es/styles/createMuiTheme.js:17
i didn't found any solution for my problem. i am using createMuiTheme for override some components.
thank you very much.
This is a common error with material-ui that occurs when you import a component with /es in the path.
Search on your code if at some point you import createMuiTheme. You most likely import it from #material-ui/core/es/styles..., instead, import it this way:
import { createMuiTheme } from '#material-ui/core/styles';