How to electron app start with yarn berry? - electron

After moving the code that was running well in the standalone repo to the monorepo, it is not working properly.
As shown in the screen below, the message compiled successfully appears and stopped the message last.
enter image description here
If it is executed normally, the logger message in main.ts that should appear is not visible.
If the below is really executed normally, more messages should appear.
enter image description here
And the following error window appears as if to confirm that an error occurred in main process again.
Error message is here.
A JavaScript error occurred in the main processUncaught Exception:
TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at Object.normalize (node:path:1128:5)
at contains (/Users/chai/Codes/apple/.pnp.cjs:32828:18)
at Object.ppath.contains (/Users/chai/Codes/apple/.pnp.cjs:32842:32)
at isPathIgnored (/Users/chai/Codes/apple/.pnp.cjs:41344:27)
at findPackageLocator (/Users/chai/Codes/apple/.pnp.cjs:41414:9)
at Object.findPackageLocator (/Users/chai/Codes/apple/.pnp.cjs:41706:14)
at findApiPathFor (/Users/chai/Codes/apple/.pnp.cjs:41797:41)
at Object.getApiPathFromParent (/Users/chai/Codes/apple/.pnp.cjs:41848:36)
I know that a type error occurred because the path argument that should be entered as a string entered undefined, but I cannot identify the exact location of the error.
However, considering that .pnp.cjs is a 'map' for the dependency and installation location of yarn packages, it can be assumed that there is something wrong with the package installation.

I ran into something similar and the issue was that electron was not loading my .pnp.cjs. To fix this, I add the following environment variable to my start script:
"scripts": {
"start": "NODE_OPTIONS='--require path/to/.pnp.cjs' electron ."
}

Related

Why Zerobranestudio Configuration error occurs?

Error while loading configuration file: 'cannot open C:\Users\안진형\Desktop\ZeroBraneStudio.zbstudio\user.lua: Invalid argument'.
Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument
What is "ZEROBR~1" in directory? and Why this message occurs?
I'm setting this program for code debugging and changeing color scheme of zerobranestudio, but I don't know how to open code file and how to change color scheme.
I've tried to do this and succeed to open tommorow.lua. Then Why this error message occurs?
How can i change color scheme?
http://bitstopixels.blogspot.com/2016/09/changing-color-theme-in-zerobrane-studio.html
I've tried this manual and succeed to open scheme-picker.lua. In that link's statement, If i choose color like "Tommorownightblue", Zerobranestudio's color changed to that color. But when i clicked "TommorownightBlue", Error while loading configuration file: cannot open C:\Users\안진형\Desktop\ZEROBR~1\cfg\tomorrow.lua: Invalid argument message occurs.
I'm not absolutely sure, but I'd try loading the configuration files from a different location. Can you move ZeroBrane Studio installation to a location that doesn't have your username in it, as I suspect it may be some encoding issue, which doesn't allow the file name to be properly passed to the open function.

Issues with connecting Twilio Flex Digital Channels to Google Dialogflow CX

I have been following the blog post here and I've made it to testing the function on my local environment. I've copy and pasted everything form the blog into my text editor. Nothing in my code is original - but I cannot get it to work! When I try to run it in my local environment, I get this error:
const b = bindings[key].toString();
^
TypeError: Cannot read properties of undefined (reading 'toString')
at PathTemplate.render (/Users/dialogflow-cx/node_modules/google-gax/build/src/pathTemplate.js:114:37)
at SessionsClient.projectLocationAgentSessionPath (/Users/dialogflow-cx/node_modules/#google-cloud/dialogflow-cx/build/src/v3/sessions_client.js:1237:75)
at exports.handler (/Users/Waterfield/dialogflow-cx/functions/dialogflow-detect-intent.protected.js:21:25)
at process.<anonymous> (/Users/dialogflow-cx/node_modules/#twilio/runtime-handler/dist/dev-runtime/internal/functionRunner.js:74:9)
at process.emit (node:events:390:28)
at emit (node:internal/child_process:917:12)
at processTicksAndRejections (node:internal/process/task_queues:84:21)
I don't know where to go from here! Help!
Here your TypeError is "cannot read properties of undefined", that means at least one of your passed arguments is undefined.
As we go through your return error, second line directs to the "projectLocationAgentSessionPath" and this section refers to the "Setup the detectIntentRequest" in the blog .
session: client.projectLocationAgentSessionPath(
context.DIALOGFLOW_CX_PROJECT_ID,
context.DIALOGFLOW_CX_LOCATION,
context.DIALOGFLOW_CX_AGENT_ID,
event.dialogflow_session_id
)
The above error means at least on of the objects that relates to projectId, location, agentId, SessionId is returning undefined.
To resolve the error you have to check whether you are passing correct environment variables the same as .env files or not?
Within the error, we can see that there is a reference to the code you are working on:
at exports.handler (/Users/Waterfield/dialogflow-cx/functions/dialogflow-detect-intent.protected.js:21:25)
This refers to this line:
client.projectLocationAgentSessionPath(
context.DIALOGFLOW_CX_PROJECT_ID,
context.DIALOGFLOW_CX_LOCATION,
context.DIALOGFLOW_CX_AGENT_ID,
event.dialogflow_session_id
)
Following the code through the dialogflow library and then the Google API extensions library shows that ultimately the code is running through the keys of the object that relate to the project, location, agent and session which map to the 4 arguments above. And at least one of them is returning undefined.
Have you added the correct environment variables to your .env file? Are you passing a dialogflow_session_id when you make a request to test this endpoint?

Rejecting re-init on previously failed class error when loading a Class with dalvikvm

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA
here:
http://forum.xda-developers.com/showthread.php?t=1340852&page=7
I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:
$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
at org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
at
org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
at java.util.jar.JarFile.getInputStream(JarFile.java:380)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
at com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
at com.sun.tools.javac.main.Main.compile(Main.java:421)
at com.sun.tools.javac.main.Main.compile(Main.java:308)
at com.sun.tools.javac.main.Main.compile(Main.java:299)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
$
It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method.
I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :
I/art ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>
I couldn't understand why this happened,
The javac script uses android's dalvikvm command to load
com.spartacusrex.spartacuside.external.javac
class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.
I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working.
It seems like Google messed up with things in /system/lib which resulted in errors.
Answering so someone else might find it useful.

MissingMethodException is a service: "No signature of method"

Having a really strange issue in a Grails service. I have a service thats setup like this:
package com.mydomain
import java.net.URLEncoder
import java.rmi.server.UID
import java.security.*
class EmailConfirmationService {
def sendConfirmation(Person person) {}
}
And I'm calling it from a controller with emailConfirmationService.sendConfirmation(person)
When I startup the Grails app, it throws the following error:
MissingMethodException occurred when processing request: [POST] /api/people/
No signature of method: mydomain.api.EmailConfirmationService.sendConfirmation() is applicable for argument types: (com.mydomain.Person) values: [name#mydomain.com]
All I have to do is save the EmailConfirmationService file, the watcher picks it up and recompiles, then it works great and never again throws that error.
Until I restart, then it errors until I save that file again.
I've tried the following but nothing has worked yet:
clean build
changed function name
made sure person instance existed
Any ideas?
Your service states another package (com.mydomain) than the one in the error message (mydomain.api). Please make sure, that the packages match and that the file is located in grails-app/services/com/mydomain/EmailConfirmationService.groovy (unless all of this is due to some obfuscation you did for SO)

How to supress Entry Point Not Found error on loading Delphi package?

I maintain a program written in Delphi 6. It loads some bpl package files dynamically using SysUtils.LoadPackage. Often I change something in the program that causes a package to fail to load. When this happens a message box appears and then an exception is thrown. The message box and exception are separate.
Here's an example of the message box:
---------------------------
Connect Manager: ConnectManager.exe - Entry Point Not Found
---------------------------
The procedure entry point #Connectmanagerplugin#TConnectManagerPluginClassList#UnRegister$qqrp17System#TMetaClass could not be located in the dynamic link library ConnectManagerPack.bpl.
---------------------------
OK
---------------------------
And here's the exception:
---------------------------
Debugger Exception Notification
---------------------------
Project ConnectManager.exe raised exception class EPackageError with message 'Can't load package Projects.bpl.
The specified procedure could not be found'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
I can't see how to stop the message box from appearing. Any ideas accepted gratefully.
Solved!
I created a copy of SysUtils.LoadPackage in my application and edited this copy to pass a second param to SafeLoadLibrary.
So the call to SafeLoadLibrary now looks like:
Result := SafeLoadLibrary(Name, SEM_FAILCRITICALERRORS);
This helped: http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx.

Resources