Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Errors are multiplied and assigned to wrong file #426

Closed
florianf opened this issue Feb 5, 2016 · 3 comments
Closed

Errors are multiplied and assigned to wrong file #426

florianf opened this issue Feb 5, 2016 · 3 comments
Labels
Milestone

Comments

@florianf
Copy link

florianf commented Feb 5, 2016

Hi,
carto.Renderer reports wrong file (Stylesheet id) and repeats error 9 times with attached bogus .mml (slightly changed Tilemill road-trip project) file.
Note the invalid "invalidFunction" call and the wrong parameter call of lighting in the attached project file.

The ouput is:

labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
labels.mss:31:-1 incorrect number of arguments for lighten(). 2 expected.
labels.mss:7:1 unknown function invalidFunction(), did you mean invert(0)

Expected:

style.mss:7:1 unknown function invalidFunction(), did you mean invert(0)
style.mss:31:-1 incorrect number of arguments for lighten(). 2 expected.

Code used to load and render the file:

#!/usr/bin/env node

var fs = require('fs');
var carto = require('carto');

var mms = JSON.parse(fs.readFileSync("project.txt"));
var env = {
    returnErrors: true,
    effects: []
};

var xml = new carto.Renderer(env, { mapnik_version: "3.0.7" })

try {
    xml.render(mms);
}
catch (error) {
    console.log(error.message);    
}

Projectfile:
project.txt

florianf added a commit to florianf/tileoven that referenced this issue Feb 24, 2016
@nebulon42 nebulon42 added the bug label Mar 6, 2016
@nebulon42 nebulon42 added this to the 0.17 milestone Dec 11, 2016
@nebulon42
Copy link
Collaborator

Partial fix in c88ff34. The file name is now correct. Not sure why the error occurs that often. I would expect an error each time the variable @water is evaluated, but that should happen only twice.

@nebulon42
Copy link
Collaborator

I succeeded in suppressing additional error messages. However, as I suspected you still get one error for each evaluation of the variable. Two in this case:

style.mss:12:32 unknown function invalidFunction(), did you mean invert(0)
style.mss:45:26 incorrect number of arguments for lighten(). 2 expected.
style.mss:12:32 unknown function invalidFunction(), did you mean invert(0)

@florianf
Copy link
Author

Just upgraded TileOven to the latest version, error display is much better now, thanks for the fix!

csytsma added a commit to tilemill-project/tilemill that referenced this issue Jan 20, 2019
Squashed changes from Tileoven:
* Updated dependencies, removed topcube.
* More height for layer pane
* Updated readme.
* Updated readme.
* Default to server mode.
* Remove options and code for running in windowed mode.
* Fix indentation via tab to be 2 spaces like auto-indentation.
* Added search to layer panel, fixed size of layer panel.
* Added changelog to readme
* Updated package.json
* Updated Readme and travis.yml
* Fix test
* Changed CI URls.
* Fixed typo in Travis URL
* Fixed button issues in Google Chrome, see https://github.com/mapbox/tilemill/issues/2534

* Removed MapBox Integration, cleaned up dependencies and fixed mbtiles preview.

* Readme update

* Added possibilty to change map layer to OSM for comparison and faster rendering in export.

* Updated readme.

* Renamed project to TileOven, added reference to EOL of TileMill https://github.com/mapbox/tilemill/issues/2543.

* Renamed in package.json

* First steps to node 4.x compatiblity, thanks to: https://github.com/paulovieira/hapi-tilemill

* Updated travis.yml to test node 4

* Fix tests

* fix another test

* Fix tests

* Fix for export crash.

* Fixed z-index overlap of layer selection box

* Fix another z-index of export panel.

* Updated readme for Node 4, thx to https://github.com/paulovieira/hapi-tilemill

* Updated readme for node-legacy

* Updated readme for node versios

* update the urls to the customized modules

* update references to the *-clima repos

* Moving layer selection styling to JS, so it won't break plugins. Should fix #2

* Moved location of styling to render method.

* Also fix #2 for export preview

* Removed native platform builds directory.

* Changed readme to reflect statement of @tmcw in https://github.com/mapbox/tilemill/issues/2543

* Fixed regular expression for carto variables in auto completion.

* Remember last selected folder in new layer dialog.

* Better comment

* Updated changelog

* Added Node 4 version to readme

* Better compatibility with kosmtik, setting datasource.type property for file based layers.
Prevents kosmtik/kosmtik#76 from happening.

* Updated changelog

* Updated codemirror to latest version

* Remove duplicated errors, see carto bug: mapbox/carto#426

* Changed layer switchting, fix bug that project isn't refreshed on change anymore.

* Bumped mapnik and carto versions.

* Fixed creation of job file in export if it doesn't exist

* only clear and reset test fixture data once before all test runs

* initialize export and cache once

* Bumped some deps like upstream

* Merted travis config from upstream

* Changed tilelive.js badge to tilelive

* Sync bones dep to upstream

* hide plugins UI - refs #1706

* Revert tests to node 0.10 like upstream

* use rimraf for windows support

* add init

* Updated readme

* Added node 6.0.0 status to readme

* Updated readme

* Update mapnik to latest.

* Bugfix for breaking editor panel when reference was opened. Removed CodemMirror syntax highlighting of intro snippets.

* Updated README

* Update cartocss to latest

* Forked millstone for node 6.9.x compatibility. Changed zip library to local-zip.

* node-zip is no more

* Updated Readme for Node 6

* Updated Readme, reduced self-praise a bit.

* Removed plugin interface completly.

* Added cloning of layers, actions shown on mouseover/out in layer panel

* Consistent naming

* Use an slightly older node-mapnik

Compat with Debian Jessie and Ubuntu 14.04

* Fix for issue #10, removing updateVersion check.

* Added search function for styles panel.

* Updated README

* Updated cartocss to latest

* Updated README

* Fix for failing test

* Update cartocss to latest

* Updated deps, mapnik & carto

* Pin request NPM version.

* Try to fix issue #14 by updating jsdom and pinning some versions

* Support for Node 8

* Updated install instructions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants