Closed mozfreddyb closed 7 years ago
Getting this one too whenever I open Atom, even with all other community packages disabled.
Atom Version: 1.11.2 Electron Version: 0.37.8 apm Version: 1.12.5 npm Version: 3.10.5 node Version: 4.4.5 System: "Arch Linux" Thrown From: file-icons package, v2.0.8
Uncaught TypeError: document.styleSheets[Symbol.iterator] is not a function
At /home/kenny/.atom/packages/file-icons/lib/ui.js:113
TypeError: document.styleSheets[Symbol.iterator] is not a function
at UI.getStyleElement (/home/kenny/.atom/packages/file-icons/lib/ui.js:113:33)
at UI.getThemeColour (/home/kenny/.atom/packages/file-icons/lib/ui.js:123:27)
at UI.checkMotif (/home/kenny/.atom/packages/file-icons/lib/ui.js:136:23)
at Immediate._ [as _onImmediate] (/home/kenny/.atom/packages/file-icons/lib/ui.js:17:27)
at tryOnImmediate (timers.js:534:15)
at processImmediate [as _immediateCallback] (timers.js:514:5)
-0:00.3.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-dracula-theme.theme-one-dark-ui)
{
"core": {
"allowPendingPaneItems": false,
"audioBeep": false,
"disabledPackages": [
"about",
"autocomplete-atom-api",
"spell-check",
"styleguide",
"timecop",
"welcome",
"deprecation-cop",
"background-tips",
"wrap-guide",
"link",
"open-on-github",
"open-in-browser",
"activate-power-mode",
"Hydrogen",
"git-log",
"merge-conflicts",
"python-nosetests",
"python-tools",
"sourcerer",
"linter-puppet-lint-for-linter-3",
"platformio-ide-terminal",
"platformio-ide",
"autocomplete-clang",
"build",
"busy",
"fonts",
"git-diff-details",
"git-plus",
"guess-indent",
"highlight-selected",
"language-docker",
"language-ini",
"language-puppet",
"linter",
"linter-docker",
"linter-gcc",
"linter-puppet-lint",
"linter-python",
"linter-rubocop",
"linter-ruby",
"linter-shellcheck",
"minimap",
"open-terminal-here",
"remote-atom",
"resize-indent",
"sort-lines",
"sync-settings",
"tool-bar"
],
"ignoredNames": [
".git",
".hg",
".svn",
".DS_Store",
"._*",
"Thumbs.db",
".pioenvs",
".piolibdeps",
".clang_complete",
".gcc-flags.json"
],
"telemetryConsent": "no",
"themes": [
"one-dark-ui",
"dracula-theme"
]
}
}
# User
adventurous-syntax, v0.2.0 (inactive)
atom-material-syntax-dark, v0.2.6 (inactive)
atom-material-ui, v1.3.9 (inactive)
atom-monokai, v0.10.4 (inactive)
autocomplete-clang, v0.10.0 (inactive)
build, v0.67.0 (inactive)
busy, v0.7.0 (inactive)
dracula-theme, v1.2.8 (active)
file-icons, v2.0.8 (active)
firewatch-syntax, v1.0.1 (inactive)
fonts, v1.8.0 (inactive)
git-diff-details, v1.4.0 (inactive)
git-log, v0.4.1 (inactive)
git-plus, v7.0.7 (inactive)
guess-indent, v0.1.0 (inactive)
highlight-selected, v0.11.2 (inactive)
Hydrogen, v1.5.3 (inactive)
language-docker, v1.1.7 (inactive)
language-ini, v1.17.0 (inactive)
language-puppet, v0.22.0 (inactive)
linter, v1.11.18 (inactive)
linter-docker, v0.1.4 (inactive)
linter-gcc, v0.6.15 (inactive)
linter-puppet-lint, v0.8.1 (inactive)
linter-puppet-lint-for-linter-3, v0.2.2 (inactive)
linter-python, v3.0.5 (inactive)
linter-rubocop, v0.5.2 (inactive)
linter-ruby, v1.2.4 (inactive)
linter-shellcheck, v1.4.3 (inactive)
merge-conflicts, v1.4.4 (inactive)
minimap, v4.25.7 (inactive)
monokai-seti, v0.7.0 (inactive)
nord-atom-ui, v0.9.0 (inactive)
nucleus-dark-ui, v0.10.19 (inactive)
open-terminal-here, v2.1.4 (inactive)
platformio-ide, v1.7.1 (inactive)
platformio-ide-terminal, v2.2.2 (inactive)
python-nosetests, v0.2.0 (inactive)
python-tools, v0.6.9 (inactive)
remote-atom, v1.3.10 (inactive)
resize-indent, v0.3.0 (inactive)
seti-syntax, v1.0.1 (inactive)
seti-ui, v1.3.2 (inactive)
slime, v1.6.1 (inactive)
sort-lines, v0.14.0 (inactive)
sourcerer, v2.0.0 (inactive)
sync-settings, v0.8.1 (inactive)
tomorrow-night-bright-syntax, v0.1.0 (inactive)
tool-bar, v1.0.1 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.2.0 (inactive)
base16-tomorrow-light-theme, v1.2.0 (inactive)
one-dark-ui, v1.6.0 (active)
one-light-ui, v1.6.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.7.0 (inactive)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (inactive)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (inactive)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (inactive)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
find-and-replace, v0.201.1 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.59.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.242.2-hotfix1 (active)
snippets, v1.0.2 (active)
spell-check, v0.68.2 (inactive)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (inactive)
symbols-view, v0.113.1 (inactive)
tabs, v0.101.0 (active)
timecop, v0.33.2 (inactive)
tree-view, v0.209.3 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (inactive)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.2 (inactive)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)
# Dev
No dev packages
I still have the problem.
Even with this line if(!document || !document.styleSheets || !packagePath) return null;
Here is the reported issue TypeError: document.styleSheets[Symbol.iterator] is not a function at UI.getStyleElement (/home/gabriel/.atom/packages/file-icons/lib/ui.js:152:33)
(Line number may be wrong!!)
For people that still have problems. As a really quick and dirty temporary fix (just to make it work).
Edit this file /.atom/packages/file-icons/lib/ui.js
And add a try catch around the code.
getStyleElement(filename){
try { <<<<< ADD [OLD CONTENT] } <<<<ADD catch(e) {return null;} <<<<<<ADD }
@gabrielklein A stack trace would be 10 times more helpful than posting a hacky short-term solution.
TypeError: document.styleSheets[Symbol.iterator] is not a function at UI.getStyleElement (/home/gabriel/.atom/packages/file-icons/lib/ui.js:151:33) at UI.getThemeColour (/home/gabriel/.atom/packages/file-icons/lib/ui.js:166:27) at UI.checkMotif (/home/gabriel/.atom/packages/file-icons/lib/ui.js:181:23) at Immediate.setImmediate (/home/gabriel/.atom/packages/file-icons/lib/ui.js:24:29) at tryOnImmediate (timers.js:534:15) at processImmediate [as _immediateCallback] (timers.js:514:5)
Alright, thank you. :) And your OS and Atom version? You appear to be running Linux.
PlatformIO IDE: 1.7.1 Core: 3.2.1 Ubuntu: 16.10
atom --version Atom : 1.11.2 Electron: 0.37.8 Chrome : 49.0.2623.75 Node : 5.10.0
Merci/danke/grazie. :)
In the process of fixing this.
Finally demystified and confirmed to be a bug and duplicate of #618. TL;DR of it: I made a naïve assumption about a feature unsupported by Atom's version of Chromium (Chrome 49). Support for Symbol.iterator
in DOM interfaces didn't land until Chrome 51. Hence why it was breaking when I attempted to loop through a non-iterable object.
MDN's support-charts make no mention of when ES6's iterator protocol was supported in array-like DOM objects. I presumed they'd been supported much longer than they really had.
Anyway, it's irrelevant now, but anybody puzzled by this issue now has a proper explanation. 👍
Uncaught TypeError: document.styleSheets[Symbol.iterator] is not a function
(see below).Atom Version: 1.11.2 Electron Version: 0.37.8 System: Ubuntu 16.04.1 Thrown From: file-icons package, v2.0.8
Stack Trace
Uncaught TypeError: document.styleSheets[Symbol.iterator] is not a function
Commands
Config
Installed Packages