Buildable libraries cannot import or export from non-buildable libraries (eslint) - nomachine-nx

I am getting above error when i import the interface from one of the library:
import { DetailsProps } from '#vite/prop-types'; //error
import styles from './header.module.less';
const initailDetails: DetailsProps = {
name: 'Arif',
city: 'Chennai',
pin: 600019,
};
export function Header() {
return (
<div className={styles['container']}>
<h1>Welcome to Header!</h1>
<ul>
{Object.values(initailDetails).map((v) => (
<li key={v}>{v}</li>
))}
</ul>
</div>
);
}
Nx report:
Node : 16.13.2
OS : darwin arm64
npm : 8.1.2
nx : 15.3.3
#nrwl/angular : Not Found
#nrwl/cypress : 15.3.3
#nrwl/detox : Not Found
#nrwl/devkit : 15.3.3
#nrwl/esbuild : Not Found
#nrwl/eslint-plugin-nx : 15.3.3
#nrwl/expo : Not Found
#nrwl/express : Not Found
#nrwl/jest : Not Found
#nrwl/js : 15.3.3
#nrwl/linter : 15.3.3
#nrwl/nest : Not Found
#nrwl/next : Not Found
#nrwl/node : Not Found
#nrwl/nx-cloud : Not Found
#nrwl/nx-plugin : Not Found
#nrwl/react : 15.3.3
#nrwl/react-native : Not Found
#nrwl/rollup : Not Found
#nrwl/schematics : Not Found
#nrwl/storybook : Not Found
#nrwl/web : Not Found
#nrwl/webpack : Not Found
#nrwl/workspace : 15.3.3
typescript : 4.8.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
#nrwl/vite: 15.3.3

This is because of the linter, you can disable it by setting false for enforceBuildableLibDependency in .eslintrc.json file.
or you can disable it by adding this comment before importing it:
// eslint-disable-next-line #nrwl/nx/enforce-module-boundaries
import { DetailsProps } from '#vite/prop-types';

Related

Reading data from Firebase RTDB using Flutter has different behavior on Android and iOS

I'm experiencing a behavior where the following call behaves differently when executed for iOS and for Android.
In Android, the following .get() call returns the expected snapshot from the chatRoomID path. However, in iOS, .get() ends up returning a snapshot of the whole node under myUser.userID.
It seems for iOS, the second child node path is disregarded...
DataSnapshot snapshot = await chatsRef
.child(myUser.userID!)
.child(chatRoomID)
.get();
print(snapshot.value);
JSON:
{
"chats" : {
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : {
"c00dca80-9077-11ec-855a-910961fc4253" : {
"chatAdmin" : "oF1b6J4Hz3NGzRb9RmSVFGJdcYi1",
"chatImage" : "https://images.pexels.com/photos/887827/pexels-photo-887827.jpeg?auto=compress&cs=tinysrgb&h=650&w=940",
"chatName" : "chef",
"chatRoomID" : "c00dca80-9077-11ec-855a-910961fc4253",
"isActivityChat" : false,
"isGroupChat" : true,
"lastMessage" : {
"lastMessage" : "Hey",
"lastMessageTime" : "2022-02-18 00:00:56.992308",
"messageID" : "-MwAC5BUz3GKPmkA1SSQ",
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : "true",
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : "false",
"psJQRp96VGWIjTDpNpMUShPNWa82" : "true",
"sendBy" : "oF1b6J4Hz3NGzRb9RmSVFGJdcYi1",
"senderName" : "Emily"
},
"muted" : {
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : false,
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : false,
"psJQRp96VGWIjTDpNpMUShPNWa82" : false
},
"users" : {
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : true,
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : true,
"psJQRp96VGWIjTDpNpMUShPNWa82" : true
}
},
"nKDsrLrcU0PgtEDV5tKpMumSDuu1_oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : {
"chatRoomID" : "nKDsrLrcU0PgtEDV5tKpMumSDuu1_oF1b6J4Hz3NGzRb9RmSVFGJdcYi1",
"isActivityChat" : false,
"isGroupChat" : false,
"lastMessage" : {
"lastMessage" : "Shut",
"lastMessageTime" : "2022-02-18 00:01:30.161511",
"messageID" : "-MwACDHlTWpQhhQFh9k8",
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : "true",
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : "false",
"sendBy" : "oF1b6J4Hz3NGzRb9RmSVFGJdcYi1",
"senderName" : "Emily"
},
"muted" : {
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : false,
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : false
},
"users" : {
"nKDsrLrcU0PgtEDV5tKpMumSDuu1" : true,
"oF1b6J4Hz3NGzRb9RmSVFGJdcYi1" : true
}
}
}
},
}
As discussed in the comments
You should be getting the same behavior on both iOS and Android, as the underlying SDKs should work the same on those platforms. That said, since the FlutterFire libraries wrap the native SDKs and the get() API is relatively new, it might be that there is an unintended difference between how the iOS and Android SDKs implement it.
If that is indeed the case, you might want try and see if once() works for you. While it has an annoying side-effect in an edge-case (see here), the once API itself is much older, so more likely to be stable across platforms.
Update: I'm having a really hard time reproducing the problem. I've imported your JSON into a database of mine, and then run this code on startup of my app:
FirebaseDatabase database = FirebaseDatabase.instance;
var chatsRef = database.ref('71163140/chats');
var threadRef = chatsRef.child('oF1b6J4Hz3NGzRb9RmSVFGJdcYi1').child('nKDsrLrcU0PgtEDV5tKpMumSDuu1_oF1b6J4Hz3NGzRb9RmSVFGJdcYi1');
DataSnapshot snapshot = await threadRef.get();
if (snapshot.value != null) {
print('get: ${snapshot.value}');
}
DatabaseEvent event = await threadRef.once();
if (event.snapshot.value != null) {
print('once: ${event.snapshot.value}');
}
So it reads a single chat thread out of the data you shared with both get() and once(), and then prints what it gets. Both on iOS and Android, I never see the c00dca80-9077-11ec-855a-910961fc4253 thread showing up in my output, I only get the chat thread where "isGroupChat" : false,.
Can you update the code or data in your question to show how I can get the same faulty result as you get?

How do I set microsoft Edge browser binary file for Selenium Remote Webdriver

I am trying to execute remote webdriver tests using Selenium Grid, My node is a Windows 8 system, and I have insider version of edge installed on it. Now when I try to execute my tests, the node starts the driver service but it is not able to find the microsoft edge binary on the node.
Machine : Windows 8
Edge Version : 77.0.235.9
binary Path : C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe
Selenium Version : 3.141.59
I tried to append the path to the edge executable "msedge.exe" on the node's Path variable -> did not work
I tried to mention the edge_binary bath in the nodeconfig.json as well, but still the executable was not found.
else if (browsername.equalsIgnoreCase("edge")) {
EdgeOptions options = new EdgeOptions();
driver = new RemoteWebDriver(new URL("http://192.168.1.107:8889/wd/hub"), options);
return driver;
}
nodeconfig.json :
{
"capabilities":
[
{
"browserName" : "chrome",
"maxInstances" : 5,
"seleniumProtocol" : "WebDriver"
},
{
"browserName" : "firefox",
"maxInstances" : 5,
"firefox_binary" : "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
"seleniumProtocol" : "WebDriver",
"acceptInsecureCerts": true,
"acceptSslCerts": true
},
{
"browserName" : "internet explorer",
"version" : "11",
"maxInstances" : 5,
"seleniumProtocol" : "WebDriver"
} ,
{
"browserName" : "MicrosoftEdge",
"platform" : "WINDOWS",
"edge_binary" : "C:\\Program Files (x86)\\Microsoft\\Edge Beta\\Application\\msedge.exe",
"version" : "77.0.235.9",
"maxInstances" : 5,
"seleniumProtocol" : "WebDriver"
}
],
"proxy" : "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession" : 10,
"port" : 5555,
"register" : true,
"registerCycle" : 5000,
"hub" : "http://192.168.1.107:8889",
"nodeStatusCheckTimeout" : 5000,
"nodePolling" : 5000,
"role" : "node",
"unregisterIfStillDownAfter" : 1000,
"downPollingLimit" : 2,
"debug" : false,
"servlets" : [],
"withoutServlets" : [],
"custom": {
"webdriver.ie.driver" : "drivers/ie/win/IEDriverServer.exe",
"webdriver.gecko.driver" : "drivers/firefox/win/geckodriver.exe",
"webdriver.chrome.driver" : "drivers/chrome/win/chromedriver.exe",
"webdriver.edge.driver" : "drivers/edge/win/msedgedriver.exe"
}
}
How can I make the executable visible to the client trying to automate it,
EdgeOptions does not allow to set a binary path as well.

How connect odoo (xmlrpc) with ionic running over ios?

I am working with ionic 3, I did an app to consume web services from odoo, for this I used a npm package: odoo-xmlrpc.
it work fine with android, but when I simulate for iPhone, it can't connect with the server. I tried a manual connection, but it wasn't worked, it show an XHR error, but no show exactly the error.
I used a sniffer(charles) to show me http packages and I get some information. it try to connect using OPTIONS Method, but the server request is 404 not FOUND.
you can see all my code here: https://github.com/jose1914luis/rusia
my configurations:
ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.6
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.0
ios-sim : 5.0.13
Node : v9.3.0
npm : 5.6.0
OS : macOS Sierra
Xcode : Xcode 8.2.1 Build version 8C1002
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Ionic Code:
import { Component, enableProdMode } from '#angular/core';
import { NavController } from 'ionic-angular';
import { Http } from '#angular/http'
import 'rxjs/Rx';
import 'rxjs/add/operator/map';
import xmlrpc from 'xmlrpc';
import url from 'url';
import * as Odoo from 'odoo-xmlrpc'
enableProdMode();
#Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
msg = '';
config = {url:'http://moscutourgratis.com',
port:'8069',
db:'Tour_Gratis_Rusia',
username:'xxxx',
password:'xxxx'};
constructor(public navCtrl: NavController, public http: Http) {
this.cargar();
}
cargar(){
var self = this;
var odoo = new Odoo(self.config);
//Fail method with odoo-xmlrpc
odoo.connect(function(err){
if(err){
self.msg += JSON.stringify(err);
console.log(JSON.stringify(err));
return JSON.stringify(err);
}
self.msg += 'entro';
});
//manual connection Fail show XHR Error
this.connect(function(err){
self.msg += 'error interno' + JSON.stringify(err);
});
}
connect(callback){
var urlparts = url.parse(this.config.url);
var host = urlparts.hostname;
var port = this.config.port || urlparts.port;
var db = this.config.db;
var username = this.config.username;
var password = this.config.password;
var secure = true;
if(urlparts.protocol !== 'https:') {
secure = false
}
var uid = 0;
var clientOptions = {
host: host,
port: port,
path: '/xmlrpc/2/common'
}
var client;
if(secure == false) {
client = xmlrpc.createClient(clientOptions);
console.log("client normal")
}
else {
client = xmlrpc.createSecureClient(clientOptions);
console.log(clientOptions)
console.log("client sécurisé sur le port " + port)
}
var params = [];
params.push(db);
params.push(username);
params.push(password);
params.push({});
client.methodCall('authenticate', params, function(error, value) {
if(error){
console.log('HOLA MUNDO ERROR DE MIERDA' + error);
return callback(error, null)
}
uid = value;
return callback(null)
});
}
}
Charles http packages:
after spend 2 weeks solving this problem, I changed the library for odoo-ionic-xml-rpc. Neither it didn't work. I found that the request return origin null in header additionally ionic >3 has integrate wkwebview, this has some problems:
I can’t implement CORS. Unfortunately there’s no API to disable this, so you’ll need to ensure any remote API that your app use, implement CORS correctly: CORS MDN
XHR requests do not work- I am trying to call some remote service using XHR (or fetch), but it is not working. As we said previously, WKWebView enforces CORS. You will need to whitelist http://localhost:8080 as “Origin” and/or implement CORS properly.
Basically you need to Downgrade to UIWebView and it worked.
modified confi.xml:
<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
uninstall cordova-plugin-ionic-webview:
$ ionic cordova plugin remove cordova-plugin-ionic-webview --save
$ rm -rf platforms/
$ rm -rf plugins/
$ ionic cordova build ios

"Flush Result : No Connectivity" Error for FBSDKAppEvents

I have integrated FBSDKCoreKit.framework to track app events, I am calling [FBSDKAppEvents activateApp] in applicationDidBecomeActive: and enabling logs using [FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorAppEvents]
In logs it's logging following error
FBSDKLog: FBSDKAppEvents: Flushed # 1473666575, 2 events due to 'Timer' - {
"advertiser_tracking_enabled" = 1;
"anon_id" = "xxxxxx-xxxxx-xxxxx-xxxxx";
"application_tracking_enabled" = 1;
event = "CUSTOM_APP_EVENTS";
extinfo = "[xxx, xxx, xxx]";
"url_schemes" = "[\"xxxxxxxx\"]";
}
Events: [
{
"isImplicit" : false,
"event" : {
"fb_mobile_launch_source" : "Unclassified",
"_session_id" : "xxxxxx-xxxxx-xxxxx-xxxxx",
"fb_mobile_app_interruptions" : 0,
"_logTime" : 1473664599,
"_ui" : "no_ui",
"_eventName" : "fb_mobile_deactivate_app",
"_valueToSum" : 155,
"fb_mobile_time_between_sessions" : "session_quanta_2"
}
},
{
"isImplicit" : false,
"event" : {
"fb_mobile_launch_source" : "Unclassified",
"_ui" : "no_ui",
"_eventName" : "fb_mobile_activate_app",
"_logTime" : 1473665765,
"_session_id" : "96FA9509-AB21-475F-9F44-3005FE5D10BC"
}
}
]
Flush Result : No Connectivity
At end of log it's showing me error Flush Result : No Connectivity
Any one know why I'm getting this error ?
I got it working by following this guide FBSDK doc here does not explain about each configuration required for tracking events

RequireJS loading jquery-ui fails after optimization

I'm not sure what causes this, but jquery-ui doesn't seem to work after optimization.
Without optimization, the project runs fine. $ contains $.ui. (Let's call this develop)
After optimization, functions depending on jquery-ui fail because $.ui does not exist.
I've been messing around with shims and requires for hours, but the result is always the same (or worse, $ not even working, although it still works in the non-optimized version.
What piece of logic am I missing?
requirejs.config({
baseUrl : 'js',
waitSeconds : 10,
urlArgs : 'cache='+Date.now(),
paths: {
"conf" : "remix/config",
"jquery" : "lib/jquery",
"jqueryUi" : "lib/jquery.ui",
"domReady" : "lib/domReady",
"bootstrap" : "lib/bootstrap",
"jsviews" : "lib/jsviews"
},
// I've had many configurations.
// Basically, develop almost always works, optimized never works.
shim: {
"jqueryUi" : {
deps : ['jquery']
},
"jsviews" : {
deps : ['jqueryUi']
},
"bootstrap" : {
deps : ['jsviews']
}
}
});
require(['domReady!', 'jsviews', 'jqueryUi', 'bootstrap'], function() {
console.log($);
// Develop: $.ui exists
// Optimized: $ exists, $.ui does not.
// (And jsviews only in some modules.)
});
According to answer: https://stackoverflow.com/a/17536078/2463365 and refernced tutorial: Load jQuery UI with requireJS.
I've just added exports: '$'
shim: {
"jqueryUi" : {
exports : '$',
deps : ['jquery']
},
and it works.

Resources