-
Notifications
You must be signed in to change notification settings - Fork 723
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
Using underscore in vendor.js seems to conflict with Restangular #1209
Comments
@Phocea: I can't reproduce the issue on the example app (using |
I will have another go and also check if the issue occur with the build under Linux. |
@jpetitcolas I still have the issue both on windows and linux build and really cant see what could cause this side effect. |
I just ran into this same issue. The weird thing is, It works fine in my dev server. When I git clone and then npm install on my production, I get TypeError: _.includes is not a function when trying to visit any entity. I'm on linux in both instances running v1 beta 2 of ng-admin. @Phocea Can you walk me through how to resolve this? |
Hello, |
Can you confirm that the PR #1208 fixed the issue? |
It does, we carry on patching the file inside our build for now. |
Re-applied changes in #1252 |
And once again reapplied in #1268 |
Description
Using the 1.0.0-alpha7 version build I am getting the error _.includes is not a function when acessing any of my entity list views
Following several threads on Restangular Git (one of them being mgonto/restangular#1225). I found this is a know issue with Restangular and various changes in the underscore and lodash librabr
Restangular 1.5.2 is now using "lodash": ">=1.3.0" which fixes the issue.
However using underscore for the _ global value offuscate it to Restangular.
This issue only occur since commit cc21984 (webpack dependencies commit).
It occurs if I use the already transpiled libs, or transpile them myself using webpack. Before this, using the minified build if ng-admin-only did not cause any problem.
Changing the following line in vendor.js fixes the problem but your CI does not like it...
from:
global._ = require('underscore');
to:
global._ = require('lodash');
The error stack encountered is (ml-sp-opui.js.js is my webpacked app):
angular.js:12798 TypeError: _.includes is not a function at Object.t.isSafe (restangular.min.js:6) at Object.O (restangular.min.js:6) at Object.A (restangular.min.js:6) at e.value (RestWrapper.js:19) at t.value (ReadQueries.js:19) at Object.e.state.resolve.rawEntry (routing.js:166) at Object.invoke (angular.js:4570) at c (angular-ui-router.js:475) at angular-ui-router.js:467 at processQueue (angular.js:15112)
The text was updated successfully, but these errors were encountered: