How can i fix this problem, I have tried everything but always the same error:
I am using this API: https://github.com/xamarin/google-apis
Convert it to explicit call to the extension:
var attribute =
Google.Apis.Util.Utilities.
GetCustomAttribute<Google.Apis.Util.RequestParameterAttribute>
(property);
Related
I'm new in Shopify, I'm having a problem when I try to use the #shopify/shopify-api.
I'm importing this property from the API.
import Shopify from '#shopify/shopify-api'
When I do the import I get the next error.
Uncaught TypeError: util.inherits is not a function
at node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js (data-stream.js:39:6)
at __require (chunk-IGMYUX52.js?v=cd28f3b3:40:50)
at node_modules/jsonwebtoken/node_modules/jws/lib/sign-stream.js (sign-stream.js:3:18)
at __require (chunk-IGMYUX52.js?v=cd28f3b3:40:50)
at node_modules/jsonwebtoken/node_modules/jws/index.js (index.js:2:18)
at __require (chunk-IGMYUX52.js?v=cd28f3b3:40:50)
at node_modules/jsonwebtoken/decode.js (decode.js:1:11)
at __require (chunk-IGMYUX52.js?v=cd28f3b3:40:50)
at node_modules/jsonwebtoken/index.js (index.js:2:11)
at __require (chunk-IGMYUX52.js?v=cd28f3b3:40:50)
So I went to the line in the file where is happening the error:
node_modules/jsonwebtoken/node_modules/jws/lib/data-stream.js
And I discovered that error is a property in a node package
if you can't see the image here the code line.
util.inherits(DataStream, Stream);
So I went to the node documentation and I found that method is discouraged, but is not deprecated, therefore it should be working.
here is the description of the method if you can't see the image.
Usage of util.inherits() is discouraged. Please use the ES6 class and extends keywords to get language level inheritance support. Also
note that the two styles are semantically incompatible.
Inherit the prototype methods from one constructor into another. The prototype of constructor will be set to a new object created from
superConstructor.
This mainly adds some input validation on top of Object.setPrototypeOf(constructor.prototype, superConstructor.prototype). As an additional convenience,
superConstructor will be accessible through the constructor.super_
property.
The package in question is named jws, I'm not so sure the purpose of this package, I had the idea to modify the file and use prototypical inheritance replacing that code line but I don't know how good an idea it is do that. furthermore I would have to do that for each file that has that problem, i haven't found any information about this on the intenet.
I am trying to convert some data to Json to send to the CloudFlare API. I am attempting to use Newtonsoft.Json.JsonConvert.SeriablizeObject() to accomplish this but I am getting the Intellisense error that the type name 'serializeObject' does not exist in the type 'JsonConvert'. I have the NuGet package Newtonsoft.Json installed but it does not recognize the SerializeObject() method. I am not sure what I am missing.
Its because you're calling the method wrong, remove the new operator from the line
var json = new JsonConvert.SerializeObject(updateDnsRecord);
to
var json = JsonConvert.SerializeObject(updateDnsRecord);
I am trying the fusionauth-node-client and following the wiki https://fusionauth.io/docs/v1/tech/client-libraries/node. But I am getting the following error
const client = new FusionAuthClient('6b87a398-39f2-4692-927b-13188a81a9a3', 'http://localhost:9011');
^
TypeError: FusionAuthClient is not a constructor
at Object.<anonymous>
I have pasted the exact code mentioned in the doc still it is not working. Can anyone help me in identifying what I am missing here.
I dug around in the library and noticed that we are exporting several objects and our example is no longer correct.
To get the client you need to change your syntax a little bit to get the correct object.
const {FusionAuthClient} = require('fusionauth-node-client');
This translates to: require the library fusionauth-node-client and give me the FusionAuthClient from inside it. There are also a RESTClient and JWTManager available in the library but you shouldn't need either of those to code with FusionAuth.
I will also update our example to correct this discrepancy.
I am trying to do the following bootstrapping:
x.For(Of IErrorLogger).Use(Of ErrorLogger.SQLErrorLogger)().
Ctor(Of IErrorLogger)("backupErrorLogger").Is(ObjectFactory.GetNamedInstance(Of IErrorLogger)("Disk"))
x.For(Of IErrorLogger).Add(
Function()
Return New ErrorLogger.DiskErrorLogger(
CreateErrorFileName(ServerMapPath(GetAppSetting("ErrorLogFolder"))))
End Function).Named("Disk")
But it shows this error:
StructureMap Exception Code: 200
Could not find an Instance named "Disk" for PluginType Logging.IErrorLogger
I sort of understand why this is happening.. the question is, how do I utilize a named instance within the registry? Maybe something like lazy initialization for the ctor argument for the SQLErrorLogger? I am not sure how to make it happen.
Thanks in advance for any help you can provide.
I found the correct way to do it in the latest version (2.6.1) of StructureMap:
x.For(Of IErrorLogger).Use(Of ErrorLogger.SQLErrorLogger)().
Ctor(Of IErrorLogger)("backupErrorLogger").Is(
Function(c) c.ConstructedBy(Function() ObjectFactory.GetNamedInstance(Of IErrorLogger)("Disk"))
)
x.For(Of IErrorLogger).Add(Function() _
New ErrorLogger.DiskErrorLogger(
CreateErrorFileName(ServerMapPath(GetAppSetting("ErrorLogFolder"))))
).Named("Disk")
Notice for the Is method of Ctor, we need to provide a func(IContext), and use the IContext.ConstructedBy(Func()) to call ObjectFactory.Get... to successfully register the IErrorLogger in this case.
This is the only way to do it as far as I know. The other Icontext methods such as IsThis and Instance will only work with already registered type.
Your problem is that you are trying to access the Container before it's configured. In order to make structuremap evaluate the object resolution after the configuration you need to provide a lambda to the Is function. The lambda will be evaluated when trying to resolve the type registered.
x.[For](Of ILogger)().Add(Of SqlLogger)().Ctor(Of ILogger)("backupErrorLogger")_
.[Is](Function(context) context.GetInstance(Of ILogger)("Disk"))
x.[For](Of ILogger)().Add(Of DiskLogger)().Ctor(Of String)("errorFileName")_
.[Is](CreateErrorFileName(ServerMapPath(GetAppSetting("ErrorLogFolder"))))_
.Named("Disk")
Disclaimer: I'm not completely up-to-date with the lambda syntax in VB.NET, but I hope I got it right.
Edit:
The working C# version of this I tried myself before posting was this:
ObjectFactory.Initialize(i =>
{
i.For<ILogger>().Add<SqlLogger>()
.Ctor<ILogger>("backup").Is(
c => c.GetInstance<ILogger>("disk"))
.Named("sql");
i.For<ILogger>().Add<DiskLogger>().Named("disk");
});
var logger = ObjectFactory.GetNamedInstance<ILogger>("sql");
$c = new Criteria();
$c->addSelectColumn('MAX('.Moto::matricula.')');
But i get this error:
Fatal error: Undefined class constant
'matricula' in /opt/lampp/htdocs/
prueba/lib/model/MotoPeer.php on line
25.
Any idea?
I'm using symfony 1.4 and propel 1.4.
Regards
Javi
It means that the class "Moto" doesn't have a variable "matricula" in it. This does not seem to have anything to do with (my)sql, but more with the (php?) class you are using.
Check out the source of that Moto class, and look if you have made a typo in the constant name?