Closed strk closed 8 years ago
Are you running in prod
mode on localhost (ie. minified js)?
Somewhat prettified:
{
"message": "Error:No value provided for variable {layerUuid}",
"file": "https://localhost/js/libleaflet.js/leaflet-0.7.3-src.js",
"line":141,
"user":"Sandro Santilli",
"project":"test"
"stack":
"L.Util.template <@https://localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:141:11
L.Util.template@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:138:1
L.TileLayer<.getTileUrl@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2898:1
L.TileLayer<._loadTile@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2972:18
L.TileLayer<._addTile@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2866:3
L.TileLayer<._addTilesFromCenterOut@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2773:4
L.TileLayer<._update@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2730:3
L.TileLayer <.redraw@https:localhost/js/lib/leaflet.js/leaflet-0.7.3-src.js:2608:4
setOptions@https:localhost/js/src/models/model.layers.js:1408:3
Wu.PostGISLayer<._refreshLayer@https:localhost/js/src/models/model.layers.js:733:1
Wu.PostGISLayer<.updateStyle@https:localhost/js/src/models/model.layers.js:699:3
Wu.Styler<._updateLayer/<@https:localhost/js/src/chrome/settings/styler.js:1170:4
Wu.Api<.post/<@https:localhost/js/src/core/api.js:284:12
Wu.Api<._post/http.onreadystatechange@https://localhost/js/src/core/api.js:302:14",
}
This https://github.com/systemapic/systemapic.js/blob/master/js/src/chrome/settings/styler.js#L1170 is the function that triggers the error. Can you console.log the args returned in this function https://github.com/systemapic/systemapic.js/blob/master/js/src/chrome/settings/styler.js#L1153 (err, newLayerJSON).
app.api.createLayer doesn't seem to be hit at all
(running in dev mode, no minified)
The last line of the stack api.js:302
is the callback from app.api.createLayer
. You could try to console log before and after that function, incl. in api.js.
I see a lot of these in the console output:
Strict-Transport-Security: The connection to the site is untrustworthy, so the specified header was ignored.
Dunno if related..
You meant js/src/core/api.js:68, right ?
Not sure if related, doubt it. Seems to be an issue with missing layerUuid
(see top of stack trace).
I mean these two lines, bottom of stack-trace,
Wu.Api<.post/<@https:localhost/js/src/core/api.js:284:12 Wu.Api<._post/http.onreadystatechange@https://localhost/js/src/core/api.js:302:14",
They show the beginning of the stack trace that ended in error. api.js:284
is the callback from xmlhttprequest
, and is fired by app.api.createLayer
function in api.js:68
, as you specified.
XXXXX err: null
styler.js (line 1154)
XXXXX newLayerJSON: {
"__v": 0,
"lastUpdated": "2016-02-12T12:04:08.779Z",
"created": "2016-02-12T12:04:08.779Z",
"legend": "",
"description": "",
"uuid": "layer-bafe76ec-0305-4039-a741-10a2ddebd0b0",
"_id": "56bdca38f79ea52c33eb8740"
}
styler.js (line 1155)
I found there are 2 "createLayer" methods in core/api.js: one around line 68 and one around line 189
The seem to be equal so shouldn't matter, but worth cleaning up, I guess
Could be a bug, ie. should be two different routes, will check.
This should already have been fixed with 43c60937ec1b758b8a67ab329bed43c2317f9a5c. Can you check if you have latest?
In app.api.createLayer:
XXXXX newLayerStyle: {"__v":0,"lastUpdated":"2016-02-12T12:13:34.590Z","created":"2016-02-12T12:13:34.590Z","legend":"","description":"","uuid":"layer-7a0fab4e-f6be-4a3f-823a-d3478d4b1187","_id":"56bdcc6ef79ea52c33eb8743"}
Then the code calls layer.updateStyle(newLayerStyle)
But I just saw another error being printed to console:
no styloe to set!
Wu.PostGISLayer<.setStyle(postgis=undefined)model.layers.js (line 684)
Wu.PostGISLayer<.updateStyle(style=Object { type="object"})model.layers.js (line 696)
Wu.Styler<._updateLayer/<(err=null, newLayerJSON="{\n "__v": 0,\n "lastUpd...cc6ef79ea52c33eb8743"\n}")styler.js (line 1173)
Wu.Api<.post/<(err=null, response="{\n "__v": 0,\n "lastUpd...cc6ef79ea52c33eb8743"\n}")api.js (line 287)
Wu.Api<._post/http.onreadystatechange()api.js (line 305)
if (!postgis) return console.error('no styloe to set!');
model.layers.js (line 684)
I have 6d64d71d1ae73fe9b9f4d0489911a29b30ab5225 (one after 43c60937ec1b758b8a67ab329bed43c2317f9a5c) and the duplicated createLayer
is still there
Besides, it's two different routes indeed, the first goges to /api/db/createLayer
and the second goes to api/layers/new
.
My browser (firefox) goes to the second (/api/layers/new
) route.
Yes, should go to /api/db/
, which is tileserver.
Found the bug, will push asap.
@strk Please check now.
Yep, now it works. Thanks!
PS: there are still two distinct "createLayer" method implementation in Wu.Api class, doesnt' the secodn override the first ? Sounds confusing to have 2 ( on line 66 and 186 ).
Great!
Yes, second overrides first. Will clean up.
Continues from https://github.com/systemapic/pile/issues/13
After clicking on "Update Style" all my data tiles disappear and no further tiles are loaded, even on navigating the map.
It might be related, I see a POST going to: https://localhost/api/error/log -- the payload is an absurd JSON with an array with a letter of the message in each element.