Brackets - DOM Agent Needs To Be Enabled First - adobe-brackets

Brackets live preview doesn't appear to be working correctly. Upon clicking live preview, the yellow lightening bolt icon is only half filled. The browser tries to start loading the live preview, however it is stuck on the brackets waiting... page.
The URL IS: file:///C:/Program%20Files%20(x86)/Brackets/www/LiveDevelopment/launch.html
I've opened up the brackets devtools (localhost:9234/devtools/devtools.html?ws=localhost:9234/devtools/page/ec744244d7ea99e5c99ffeb2ff42872e) to look for errors, and the browser console reads:
enable failed on agent css ErrorNotification.js:117
DOM agent needs to be enabled first. Object {code: -32000, message: "DOM agent needs to be enabled first."}
Object {method: "CSS.enable", id: 6, params: Object} ErrorNotification.js:117
Assertion failed: Attempted to call remote method without objectId set. /LiveDevelopment/Agents/RemoteAgent.js:58
Some arguments of method 'Runtime.callFunctionOn' can't be processed
Parameter 'objectId' with type 'String' was not found.
Object {code: -32602, message: "Some arguments of method 'Runtime.callFunctionOn' can't be processed", data: Array[1]}
Object {method: "Runtime.callFunctionOn", id: 7, params: Object} ErrorNotification.js:117
Some arguments of method 'Runtime.callFunctionOn' can't be processed
Parameter 'objectId' with type 'String' was not found.
Object {code: -32602, message: "Some arguments of method 'Runtime.callFunctionOn' can't be processed", data: Array[1]}
Object {method: "Runtime.callFunctionOn", id: 8, params: Object} ErrorNotification.js:117
I've Tried:
Rebooting
Uninstall / Reinstall
Removing ALL plugins
I'm out of ideas. Anyone able to help?

The "DOM agent needs to be enabled first" issue was introduced with Chrome 40 (which is not yet stable), so fix for Brackets 1.0 and earlier is to use Chrome 39. There's a pending fix for Chrome 40 for Brackets 1.1.

Related

Nextjs breaks when hash links are pressed quickly

I have links leading to hashed locations that reference IDs . When I press links relatively quickly i get this error :
Unhandled Runtime Error
Error: Cancel rendering route
What is the solution to this problem ? Maybe use Router events like 'hashChangeStart'/'hashChangeEnd' ?enter image description here
Error stack:
https://pastebin.com/2haS2SE4

Issues with lifting stringified JSON

need some help with fluentbit parsing.. really struggling here.
I've got an entry that currently looks like that in the stdout plugin:
[0] datapoints: [1635420146.768714629, {"log"=>"{"#timestamp": "2021-09-29T06:36:48.989Z", "#version": 1, "source_host": "17dcffbb12af", "name": "my_nice_log"}"}]
I'm trying to lift that log field so I'll get my inner JSON as a map.
Unfortunately, I'm getting the following error in the logs:
[2021/10/28 15:10:02] [ warn] [filter:nest:nest.5] Value of key 'log' is not a map. Will not attempt to lift from here
Tried to use JSON parser on that field, without success, it doesn't change anything, the JSON is still stringified.

$http returning error response NULL on first call after launch (ionic) everytime, but after subsequent http post its ok

Whenever I launch my app, and click on login on the first few tries, the login will attempt a POST http to the server. However $http always (everytime) returns NULL on first try. sometimes after several few tries still NULL if done fast. But subsequently, its all ok.
I dont get it, why is $http returning error response NULL initially ??
Here is my login controller doing the http post
Login Controller (LoginCtrl)
https://gist.github.com/anonymous/771194bc5815e4ccdf38b57d6158853f
var req = {
method: 'POST',
url: baseURL,
data: postObject,
//timeout: 5000
};
err is NULL here:
}).error(function(err) {
I dont know if it is CORS but I'ved got this set in config.xml
<access origin="*" />
my config.xml
https://gist.github.com/anonymous/b2df3a857338d14ec3fcd6dda776e212
Any ideas ?
Im using ionic 1.7.14
on device iOS 9.3.1
UPDATE
I'ved put the problem code here. can logout first to goto login screen. enter in anything in username/password field, click login once failed, second or third try will be success.
https://github.com/axilaris/ionic_null_http_problem
some troubleshooting so far: i noticed the http post request is called twice. not sure why.
UPDATED the code using $http.post.then but still has the same effect
$http.post(baseURL, postObject).then(function successCallback(response)
response has NULL data --> Object {data: null, status: 0, config: Object, statusText: ""}
It is hard to diagnose having the above details only.
However the problem could be that your handler (login function) is triggered before digest cycle finished updating $scope.data.username and $scope.data.password and for the first tries it sends empty values for those to the server and works fine later.
You can run Safari web inspector to see what is sent to the server to prove this.
The fix may depend on how your view/template is coded. Can you please share it? Or, ideally, create a working sample at http://play.ionic.io/
Another option to fix could be to try to wrap your code related to http request into
$timeout(function() {
// your code goes here
});
or, consider using .$applyAsync() (see the docs for details)
This might help to fix the problem
You are probably getting this inconsistent behavior as you are using the 'success' promise method instead of 'then' (note that use of the success method has now been deprecated).
The key differences between these two methods are:
then() - full power of the promise API but slightly more verbose
success() - doesn't return a promise but offeres slightly more convienient syntax
as highlighted in this answer.
Hence in your scenario, instead of using 'success':
var req = {
method: 'POST',
url: baseURL + 'session/login',
data: postObject,
//timeout: 5000
};
$http(req).success(function(resp) {...
use 'then' along with angular's post shortcut method (you don't have to use this shortcut method, but I think it makes the code more succinct) e.g.:
$http.post(baseURL + 'session/login', postObject).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
Using 'then' returns a promise resolved with a value returned from a callback, so it should give you a consistently valid result.
it was a timeout in app.js that caused it. was set to 1 second which gives it it arbitrary success rate.
config.timeout = 1000;

Meteor: Match error: Failed Match.OneOf or Match.Optional validation (websocket)

I have a website that uses Meteor 0.9. I have deployed this website on OpenShift (http://www.truthpecker.com).
The problem I'm experiencing is that when I go to a path on my site (/discover), then sometimes (though not always), the data needed are not fetched by Meteor. Instead I get the following errors:
On the client side:
WebSocket connection to 'ws://www.truthpecker.com/sockjs/796/3tfowlag/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
And on the server side:
Exception from sub rD8cj6FGa6bpTDivh Error: Match error: Failed Match.OneOf or Match.Optional validation
at checkSubtree (packages/check/match.js:222)
at check (packages/check/match.js:21)
at _.extend._getFindOptions (packages/mongo-livedata/collection.js:216)
at _.extend.find (packages/mongo-livedata/collection.js:236)
at Meteor.publish.Activities.find.user [as _handler] (app/server/publications.js:41:19)
at maybeAuditArgumentChecks (packages/livedata/livedata_server.js:1492)
at _.extend._runHandler (packages/livedata/livedata_server.js:914)
at _.extend._startSubscription (packages/livedata/livedata_server.js:764)
at _.extend.protocol_handlers.sub (packages/livedata/livedata_server.js:577)
at packages/livedata/livedata_server.js:541
Sanitized and reported to the client as: Match failed [400]
Can anyone help me to eliminate this error and get the site working? I'd be very grateful!
Tony
P.S.: I never got this error using localhost.
EDIT:
The line causing the problem the problem is this (line 41):
return Activities.find({user: id}, {sort: {timeStamp: -1}, limit:40});
One document in the activities collection looks like this:
{
"user" : "ZJrgYm34rR92zg6z7",
"type" : "editArg",
"debId" : "wtziFDS4bB3CCkNLo",
"argId" : "YAnjh2Pu6QESzHQLH",
"timeStamp" : ISODate("2014-09-12T22:10:29.586Z"),
"_id" : "sEDDreehonp67haDg"
}
When I run the query done in line 41 in mongo shell, I get the following error:
error: { "$err" : "Unsupported projection option: timeStamp", "code" : 13097 }
I don't really why this is though. Can you help me there as well? Thank you.
Make sure that you are passing an integer to skip and limit. Use parseInt() if need be.
You have a document on your website that does not match your check validation.
The validation you have is in app/server/publications.js:41
So the attribute in question exists in some way like Match.optional(Match.oneOf(xx)) but the document's attribute is neither of the values in Match.oneOf
You would have to go through your documents for the collection causing this and remove or correct the attribute causing this to match your check statement.
Update for your updated question.
You're running Meteor commands in the meteor mongo/mongo shell. The error you get is unrelated to the problem in Meteor, to sort in the mongo shell you would do activities.find(..).sort(), instead of activities.find(.., { sort : {..}). This is unrelated to the issue
The issue is most-likely that your id is not actually a string. Its supposed to be sEDDreehonp67haDg for the document you're looking for. You might want to use the debugger to see what it actually is.
I don't think you can use limit in client-side find queries. Removing limit from my query solves the problem. If you're looking for pagination, then you can either manually roll your own by passing a parameter to your Activities publication so that the limit is added to the server-side query along with an offset. There is also this pagination package.

Inconsistent access to Meteor collection within client code vs. in console

Something terribly simple is giving me a hard time. I can reproduce the issue by creating a blank app using mrt create, adding only the following:
On line 1, I create a new collection:
Rounds = new Meteor.Collection('rounds');
In the Meteor.isClient conditional code, I add:
Rounds.insert({ x: 1 });
Rounds.find({}).forEach(function (round) {
console.log(round);
});
When I run this code the first time (locally, using meteor run), the expected behavior emerges and the following line is printed to the console:
Object {x: 1, _id: "ps5KdA4b9it2ktQoD"}
If I refresh the browser, however, something unexpected happens. I expect to see multiple lines printed to the console, since I am adding additional rounds to my collection. However, only the most recent round is printed:
Object {_id: "dqMuz6CmK2K9myZn5", x: 1}
If, instead, I run the forEach lines above directly in the console, I get the expected behavior, with one printed line for each round in the collection:
Rounds.find({}).forEach(function (post){
console.log(post);
})
Object {_id: "KAcopbPDE9JC2rShY", x: 1}
Object {_id: "ps5KdA4b9it2ktQoD", x: 1}
Object {_id: "dqMuz6CmK2K9myZn5", x: 1}
Object {_id: "ecbWcRXXLQANy8Xyj", x: 1}
Object {_id: "QsbczHmZZMX59LzTZ", x: 1}
Why is the behavior different in these two cases? And, most importantly, how do I reproduce the behavior I find in the console (which I expected) in the actual code?
Thanks.
It might be that Meteor hasn't actually established a connection to the server yet, remember meteor loads js & html on the client first (at which point all the code is run), and it then tries to connect to the server.
During this state the commands you tell it to insert go in a queue that are inserted all at once when it connects. On the client the callbacks fire instantly if successful at the time of the insert.
So your code to insert is run, when the connection isn't yet established fully.
If you wait for a connection to establish (where Meteor.status().connected == true), or a subscription to complete (by inserting your data in the callback of Meteor.subscribe), then you shouldn't have this problem.
By the time you use the console the connection would already be established which is why you don't have the problem in the console.
You could have a go at also running a console.log(Meteor.status().connection) at the same time you try and insert the document and see.

Resources