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

Underscore not available #669

Closed
mmcfarland opened this issue Sep 12, 2016 · 0 comments
Closed

Underscore not available #669

mmcfarland opened this issue Sep 12, 2016 · 0 comments
Assignees
Labels

Comments

@mmcfarland
Copy link
Member

We have two reports of the underscore library not resolving to an object and throwing errors when functions are accessed in plugin startup scripts:

Regional Planning
main.js:66 Uncaught TypeError: _.isUndefined is not a function

Inspecting the _ variable in the declare function shows that _ is equal to the number 3, which happens to be the last character in the require:packages:location property (//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3)

The problem was also reported from an app developer, and may indicate the error is not related to Regional Planning:

The Puget Sound Coastal Defense plugin works with the master repo of the framework (at least the version on maps.coastalresilience.org) but is not compatible with the current development version. When included it causes some exception/error when starting and the framework renders the header bar only. What error is logged references the regional planning plugin (Uncaught TypeError: _.isUndefined is not a function) but I'm sure relates to some conflict with PS coastal defense and not regional planning as the same occurs for other plugins if regional planning is left out but coastal defense is included.

@mmcfarland mmcfarland added the bug label Sep 12, 2016
caseycesari added a commit that referenced this issue Dec 8, 2017
Import underscore locally and add it to the Use config so that plugins
can reference it.

Plugins that don't directly import underscore reference it through
Use, but it is properly made available through that interface.
Because of that, require.js tries to find it in the ESRI/DOJO package
and can't, which causes underscore to be undefined.

Refs #1043, #669
caseycesari added a commit to CoastalResilienceNetwork/regional-planning that referenced this issue Dec 13, 2017
Issues referencing underscore in plugins was remedied in CoastalResilienceNetwork/GeositeFramework#669. Local imports of underscore are no longer needed.
@kellyi kellyi closed this as completed Dec 14, 2017
caseycesari added a commit that referenced this issue Jan 4, 2018
Adjust the use config to support all of the various ways that underscore
is imported within plugins.

The previous fix implemented in #1044 caused problems with plugins that
bring in their own version of underscore in via a CDN. The adjustments
here should make that possible while still allowing plugins to import
underscore via Use.js.

Also, rename the framework version of underscore to reduce confusion.

Refs #669, #1043, #1046
@caseycesari caseycesari self-assigned this Jan 4, 2018
caseycesari added a commit that referenced this issue Jan 4, 2018
Adjust the use config to support all of the various ways that underscore
is imported within plugins.

The previous fix implemented in #1044 caused problems with plugins that
bring in their own version of underscore in via a CDN. The adjustments
here should make that possible while still allowing plugins to import
underscore via Use.js.

Also, rename the framework version of underscore to reduce confusion.

Refs #669, #1043, #1046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants