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

Object doesn't support property or method 'slice' #34180

Closed
h3llbring0r opened this issue Dec 2, 2019 · 4 comments
Closed

Object doesn't support property or method 'slice' #34180

h3llbring0r opened this issue Dec 2, 2019 · 4 comments

Comments

@h3llbring0r
Copy link

@h3llbring0r h3llbring0r commented Dec 2, 2019

[...new Set(properties)]

gets to

new Set(l).slice()

in ES5 bundle, which fails in browser, because Set has no slice() method.

Tested in Internet Explorer 11.1069.17134.0.

Used packages:

"dependencies": { "@angular/animations": "^8.2.14", "@angular/cdk": "^8.2.3", "@angular/common": "^8.2.14", "@angular/compiler": "^8.2.14", "@angular/core": "^8.2.14", "@angular/forms": "^8.2.14", "@angular/platform-browser": "^8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/router": "^8.2.14", "@ngx-translate/core": "^11.0.1", "@ngx-translate/http-loader": "^4.0.0", "angular-draggable-droppable": "^4.3.8", "array-sort": "^1.0.0", "core-js": "^2.5.7", "lodash": "^4.17.15", "moment": "^2.24.0", "moment-timezone": "^0.5.27", "ngx-cookie-service": "^2.2.0", "primeflex": "^1.0.0", "primeicons": "2.0.0", "primeng": "8.1.1", "rxjs": "^6.5.3", "ts-odata": "0.3.0", "web-animations-js": "^2.3.2", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "^0.803.19", "@angular/cli": "^8.3.19", "@angular/compiler-cli": "^8.2.14", "@angular/language-service": "^8.2.14", "@fortawesome/fontawesome-free": "^5.11.2", "@types/array-sort": "^1.0.0", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "^2.0.8", "@types/lodash": "^4.14.149", "@types/moment-timezone": "^0.5.12", "@types/node": "~8.9.5", "codelyzer": "^5.1.2", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "protractor": "^5.4.2", "selenium-webdriver": "^4.0.0-alpha.5", "ts-node": "~7.0.1", "tslint": "~5.20.1", "tslint-eslint-rules": "^5.4.0", "typescript": "~3.5.3", "webpack-bundle-analyzer": "^3.6.0" }

@MrJithil

This comment has been minimized.

Copy link
Contributor

@MrJithil MrJithil commented Dec 3, 2019

Set doesn't have 'slice` methods. Please refer MDN for the documentation.

@newq

This comment has been minimized.

Copy link

@newq newq commented Dec 3, 2019

@MrJithil i think that's exactly the point of what is written above. the conversion (transpile!?) from typescript code to the incorrect Set(1).slice() happens on ng build.

@mhevery

This comment has been minimized.

Copy link
Member

@mhevery mhevery commented Dec 3, 2019

Please provide a repro case.

@ngbot ngbot bot modified the milestone: needsTriage Dec 3, 2019
@h3llbring0r

This comment has been minimized.

Copy link
Author

@h3llbring0r h3llbring0r commented Dec 4, 2019

Solved. Source of the problem was dev dependency @angular-devkit/build-angular with version 0.803.19. Changed version to 0.803.20 and now the ES5 bundle is generated with __spread(new Set(l)).

@h3llbring0r h3llbring0r closed this Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.