Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with missing requires #785

Closed
tschaub opened this issue Jun 12, 2013 · 2 comments
Closed

Trouble with missing requires #785

tschaub opened this issue Jun 12, 2013 · 2 comments

Comments

@tschaub
Copy link
Member

tschaub commented Jun 12, 2013

I've been having some build failures due to missing requires that I'm suspect of. In the case of this failure, the report is that a goog.require is missing for ol.expression.

Adding more detail to the messages from build.py (see #784), it looks like the script assumes lexer.js:791 is using something it hasn't goog.required. In this case, the ol.expression.Char object is defined in the same file.

@twpayne
Copy link
Contributor

twpayne commented Jun 12, 2013

The checking missing requires code is pretty crude. It just uses longest possible string matching, and this can cause problems if substrings happen to match. In this case:

  • It detects that ol.expression is provided.in expression.js:1
  • There are no provides for ol.expression.Char
  • Therefore the longest match is ol.expression, which is not goog.required, causing the error message

Short of using a proper JavaScript parser to detect provides and requires, the quick workaround is probably to add goog.provide('ol.expression.Char);` to lexer.js.

@tschaub
Copy link
Member Author

tschaub commented Jun 12, 2013

Thanks for the explanation @twpayne. That's more or less what I arrived at, and 2cc1379ddeb1e32b6dc7038d16d932c14e288206 does indeed satisfy. I can't think of any ill effects of the extra goog.provide, so I think I'll close this issue.

@tschaub tschaub closed this as completed Jun 12, 2013
afabiani pushed a commit to geosolutions-it/openlayers that referenced this issue May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants