Failed to compile ant-desing-pro component - antd

import Login from 'ant-design-pro/lib/Login';
const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
it's give me an import error
Failed to compile
./src/index.js
Module not found: Your application tried to access ant-design-pro, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
i use yarn package manager becouse my npm can't run ant-design-template
here is my dependencies
dependencies:
"#ant-design/compatible": ^1.0.2
"#ant-design/icons": ^4.7.0
ant-design-pro: latest
antd: ^4.20.6
babel-plugin-import: ^1.11.0
customize-cra: ^0.2.12
enquire-js: ^0.2.1
less: ^3.9.0
less-loader: ^4.1.0
prop-types: ^15.8.1
rc-banner-anim: ^2.2.2
rc-queue-anim: ^1.6.12
rc-scroll-anim: ^2.5.6
rc-tween-one: ^2.3.4
react: ^16.8.3
react-app-rewired: ^2.1.0
react-dom: ^16.8.3
react-scripts: 2.1.5

Related

Flutter The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?

I'm getting the following error when I try to run the flutter app on my iPhone simulator.
Error (Xcode):
../../../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be
assigned to the parameter type 'void Function(TapDragDownDetails)?'.
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.```
here is my dependancies
cupertino_icons: ^1.0.2
flutter_redux: ^0.10.0
dio: ^4.0.3
redux_thunk: ^0.4.0
url_launcher: ^6.1.5
modal_bottom_sheet: ^2.0.0
dropdown_search: ^5.0.5
flutter_html: ^2.1.5
linkable: ^3.0.1
lottie: ^2.2.0
flutter_rating_bar: ^4.0.0
shared_preferences: ^2.0.7
device_info_plus: ^8.0.0
percent_indicator: ^4.2.2
animated_widgets: ^1.1.0
skeletons: ^0.0.3
google_mobile_ads:
firebase_core:
firebase_analytics: ^10.1.0
webview_flutter_plus:
gsheets: ^0.4.2
get_it: ^7.2.0
woocommerce_api: ^0.1.0
skeleton_loader: ^2.0.0+4
I've tried the following.
am using the flutter stable channel.
flutter clean
flutter upgrade
by removing xCode derived data.
also I tried to fix the error showing by changing the parameter type even it's a package, but then I've to change the code on flutter sdk too. I tried to do that too but still not luck.
Since the flutter_math_fork is not a package that I use directly.
I had to find the issue by running flutter pub deps to see the dependancy graph and find the usage of the package. Then I realised that It is a dependancy of flutter_html then I tried to update the version of flutter_math_fork as well as flutter_html but it wasn't success. So I removed that package and used the following package flutter_widget_from_html as an alternative to the flutter_html then the problem solved.

Error: The non-abstract class 'ChromeProxyService' is missing implementations for these members:

I did a pub build this morning and all of a sudden, something that was compiling fine yesterday, with no changes today, is breaking.
Failed to precompile webdev:webdev:
../../../.pub-cache/hosted/pub.dartlang.org/dwds-3.1.3/lib/src/services/chrome_proxy_service.dart:40:7: Error: The non-abstract class 'ChromeProxyService' is missing implementations for these members:
- VmServiceInterface.getSupportedProtocols
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChromeProxyService implements VmServiceInterface {
^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/vm_service-4.1.0/lib/src/vm_service.dart:745:24: Context: 'VmServiceInterface.getSupportedProtocols' is defined here.
Future<ProtocolList> getSupportedProtocols();
^^^^^^^^^^^^^^^^^^^^^
Precompiling executables... (1.9s)
I've done a cache repair, another get to see if there are newer versions, I've done an upgrade just to be sure, but as soon as I hit activate webdev, I get the above error.
~/Code/dart-sdk-2.8.4/bin/pub cache repair
~/Code/dart-sdk-2.8.4/bin/pub get
~/Code/dart-sdk-2.8.4/bin/pub upgrade
~/Code/dart-sdk-2.8.4/bin/pub global activate webdev
~/Code/dart-sdk-2.8.4/bin/pub global run webdev build --verbose --output=web:build -- --delete-conflicting-outputs || exit
This is my pubspec.yaml, not much in there
name: blah
version: 0.0.0
description: Blah
environment:
sdk: ">=2.8.0 <3.0.0"
dev_dependencies:
build_runner: ^1.10.0
build_test: ^0.10.2
build_web_compilers: ^2.11.0
test: ^1.0.0
And I'm on Dart 2.8.4 (getting the same on other versions of Dart, so not sure if the Dart version has an effect)
Any ideas?
Seems like there's a temp workaround
pub global activate webdev 2.5.6
https://github.com/dart-lang/webdev/issues/1036
https://github.com/dart-lang/webdev/issues/1037

Can't load Kernel binary (Dart SDK dev.69.4)

I’m so sorry, but ... this time too I have a problem after updating the Dart SDK.
My pubspec.yaml file is:
environment:
sdk: '>=2.0.0-dev.69.4 <2.0.0'
dependencies:
sass_builder: ^2.1.1
angular: ^5.0.0-beta+2
angular_components: ^0.9.0-beta+2
angular_forms: ^2.0.0-beta+2
angular_router: ^2.0.0-alpha+17
js: ^0.6.1+1
path: ^1.6.2
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
test: ^1.3.0
I runned pub global activate webdev and pub upgrade commands. After this, I runned webdev serve, but I received the following error message:
Can't load Kernel binary: File size is too small to a valid kernel file.
webdev failed with an unexpected exception.
Unable to spawn isolate: Error while initializing Kernel isolate
How can I solve this issue?
It is likely that for the next update I will wait for the stable version of the Dart SDK.
I have the same problem, you can use "pub run build_runner serve" as workaround.

Webdev failed with an unexpected exception (Dart SDK 2.0.0-dev.69.1)

I have updated Dart SDK to 2.0.0-dev.69.1 version.
Also, I hace updated my pubspec.yaml file to this:
environment:
sdk: '>=2.0.0-dev.69.1 <2.0.0'
dependencies:
sass_builder: ^2.1.1
angular: ^5.0.0-beta+2
angular_components: ^0.9.0-beta
angular_forms: ^2.0.0-beta+2
angular_router: ^2.0.0-alpha+17
js: ^0.6.1+1
path: ^1.6.2
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
test: ^1.3.0
I run the command pub global activate webdev.
⚠ After these steps, I tried to run webdev serve command. I receive this error message:
webdev failed with an unexpected exception.
Unable to spawn isolate: file:///C:/Users/marco/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.32.3/lib/src/dart/analysis/library_context.dart:96:34: Error: Can't return a value from a void function.
return appendLibraryFiles(targetLibrary);
^
❔ Did you also find the same problem? How can I solve this problem?
Thanks!
There is an issue with SDK 2.0.0-dev.69.1 -- see this announcement. I'm not sure if it is related, but you might need to wait for the next release of the SDK, or downgrade to 2.0.0-dev.69.0.

package "dart_to_js_script_rewriter" is not a dependency

I just started learning dart.
first I created an angular2-dart based project from https://angular.io/docs/dart/latest/quickstart.html and it worked properly.
now I want to add auth0-lock dart package from https://pub.dartlang.org/packages/auth0_lock, so I modified pubspec.yaml to the following:
name: go_dart_angular2_zingchart
description: Go Dart Angular2 with ZingChart Started Kit
version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: ^2.0.0-beta.18
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
auth0_lock: ^0.1.0
transformers:
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: client/web/main.dart
- dart_to_js_script_rewriter
and now when I execute pub get I get the following error:
Error on line 15, column 3 of ../../../.pub-cache/hosted/pub.dartlang.org/auth0_lock-0.1.0/pubspec.yaml: Error loading transformer "dart_to_js_script_rewriter": package "dart_to_js_script_rewriter" is not a dependency.
- dart_to_js_script_rewriter
^^^^^^^^^^^^^^^^^^^^^^^^^^
since I'm new to dart and not entirely sure what I'm doing.. I have no idea how to fix this :)
any ideas ?
thanks!
I get the same error when adding auth0_lock: ^0.1.0 to my dependencies and running pub get. The error message says that "dart_to_js_script_rewriter" is not a dependency in the pubspec.yaml of the auth0_lock package. It looks like it's added under dev_dependecies if you look here. Dev dependencies of any dependent packages are ignored. Pub only gets your package’s dev dependencies.
So I think this is a problem in their package.
So, what I did was I went to https://github.com/andresaraujo/auth0_lock.dart and cloned the package, added it into my own project root in a directory called auth0_lock. And then, in my pubspec.yaml i put:
auth0_lock:
path: auth0_lock
After that I can import it using
import 'package:auth0_lock/auth0_lock.dart';

Resources