How can I use ChromeDriverManager().install() when deploying to fly.io - selenium-webdriver

I have a questions bothering me for weeks.
I am deploying a web-scratching website to fly.io. The testing at my local notebook is OK without mistake.
But when I deploying it to fly.io, it will turn out some error. Following information are my code and the error showed on fly.io. Thanks a lot!
Code:
import selenium
from selenium import webdriver
from selenium.common.exceptions
from webdriver_manager.chrome import ChromeDriverManager
browser = webdriver.Chrome(ChromeDriverManager().install())
browser.get("http://example.com")
ERROR from fly.io:
2023-02-18T08:23:40.866 app\[e911729f\] nrt \[info\] raise WebDriverException()
2023-02-18T08:23:40.866 app\[e911729f\] nrt \[info\] selenium.common.exceptions.WebDriverException: Message: Service /home/cnb/.wdm/drivers/chromedriver/linux64/110.0.5481.77/chromedriver unexpectedly exited. Status code was: 127

Related

Can't resolve 'http2' error when importing Clarifai API

I have an issue I can not seem to resolve, I am new to this and don't know whether there is something wrong in my code or the server is simply not available.
I am trying to import face recognition API from Clarifai into React App, followed the npm guide how to install, but once I do
import {ClarifaiStub, grpc} from "clarifai-nodejs-grpc";
I get an error
./node_modules/#grpc/grpc-js/build/src/server.js
Module not found: Can't resolve 'http2' in 'C:\Users\mkura\Documents\GitHub\find-the-face\node_modules\#grpc\grpc-js\build\src'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Actualy, there is const {ClarifaiStub, grpc} = require("clarifai-nodejs-grpc"); in the guide, which I changed to
import {ClarifaiStub, grpc} from "clarifai-nodejs-grpc";
assuming I have to import it this way. What do I do wrong?
From your question I assert that you're trying to install the Clarifai node API into a react app.
That fails because this package is a node app using standard library features like http2 which are not available in the browser.
Instead of the clarifai-nodejs-grpc you will have to use clarifai in your react app from what I can see in their docs.

React Calendar gives Error on Internet Explorer 11

I am new to SP dev fx components and have used react-calendar linked react-calendar. I works fine on Chrome, Firefox but gives error
Object doesn't support property or method 'from'
on Internet Explorer. I have seen that it is because of Polyfill not supported with IE11. I tried to add
import 'core-js/modules/es6.promise'
import 'whatwg-fetch'
import 'core-js/modules/es6.array.iterator.js'
import 'core-js/modules/es6.array.from.js'
import 'es6-map/implement'
but got this error now
in Uncontrolled(Component)in ForwardRefin divin divin divin Unknownin Unknown
I am very new to this and not sure where else to look. Can anyone suggest me what wrong has happened.
Regards,
Saghir

After running truffle unbox react getting error

After first initialization of running truffle compile then truffle unbox react getting error Unhandled Rejection (Error): This contract object doesn't have address set yet, please set an address first.
I am trying to install a react dapp so i can learn how to create dapps so i am a beginner but i dont understand why i woulg get an error after first initialization. Also when i ran truffle unbox react it didnt complete it stopped at downloading and didnt do anything after that so it did not set up the box. then i tried truffle unbox react, unhandled rejection and that didnt work so i tried https://www.youtube.com/watch?v=X3vdaNY9KYQ and that didnt work either. To explain I went to ganache and settings and changed the port number to 8545 and then connected to local host 8545 in metamask then i changed my hostname to the numbers in node for on your network because the localhost did not work either. The farthest to a difference i got was connecting to my network and now the page is stuck at loading web3,accounts, and contract and a dialog box popped up and gave me this error.
Failed to load web3, accounts, or contract. Check console for details

A cross-origin error was thrown while working on asynchronous http calls using react-thunk in codesandbox.io

I am practicing on API calls using react-thunk. but i am getting the following error.
proxyConsole.js:64 Error: A cross-origin error was thrown. React
doesn't have access to the actual error object in development.
For practicing purpose i have referred this following linkReact-redux-tutorial
I have practiced the code in codesandbox.io. code will be available in codesandbox link
Sandbox console doesn't always gives you the full error.
However, if you open the actual browser console, you can see the full error.
The error is that Provider is not imported properly from react-redux
import Provider from "react-redux"; needs to be written as import { Provider } from "react-redux"; to fix the same

Yarn test failing - Network request failed

I created a react project using create-react-app however when ran yarn test to see if the initial tests pass I get
TypeError: Network request failed
at XMLHttpRequest.xhr.onerror (/home/ubuntu/wonderland/hackernews/node_modules/whatwg-fetch/fetch.js:436:16)
at XMLHttpRequest.callback.(anonymous function) (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:289:32)
at invokeEventListeners (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:219:27)
at invokeInlineListeners (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:166:7)
at EventTargetImpl._dispatch (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:122:7)
at EventTargetImpl.dispatchEvent (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:87:17)
at XMLHttpRequest.dispatchEvent (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:61:35)
at XMLHttpRequest.abort (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:405:16)
at Object.abort (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/xhr-utils.js:315:13)
at RequestManager.close (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:146:21)
at Window.close (/home/ubuntu/wonderland/hackernews/node_modules/jsdom/lib/jsdom/browser/Window.js:362:29)
at JSDOMEnvironment.dispose (/home/ubuntu/wonderland/hackernews/node_modules/jest-environment-jsdom/build/index.js:44:19)
at Promise.resolve.then (/home/ubuntu/wonderland/hackernews/node_modules/jest-cli/build/runTest.js:102:17)
I'm working in Cloud9 editor using ssh connected to my dev server (Ubuntu) hosted in AWS. Tests are working fine in my local machine (Ubuntu).
Thanks for the help!
I already solve my problem. I'm following a book entitled "The Road to Learn React" and I think that the one causing my error is the part where I fetch data from an external API. The book forgot to include an import for fetch which is this one:
import fetch from 'isomorphic-fetch'
Then, it solves my problem like a charm.

Resources