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

Error loading syntax file: 'Packages/Babel/JavaScript (Babel).sublime-syntax' #419

Open
IvanIsakof opened this issue Nov 9, 2021 · 19 comments

Comments

@IvanIsakof
Copy link

Hello, after update sublime I have new error:
Error loading syntax file "Packages/Babel/JavaScript (Babel).sublime-syntax": Packages/Babel/JavaScript (Babel).sublime-syntax: no such target scope:source.js.css#at-keyframe-block-content
image

And my syntax hasn't definitions:
image

My sublime version is:
image

My OS version:

  • Ubuntu 16.04 LTS
@Thom1729
Copy link
Contributor

Thom1729 commented Nov 9, 2021

Can you post your list of installed packages? It looks like it's having an problem loading the new Styled Components definition, and I wonder if a third-party package is interfering with that.

@IvanIsakof
Copy link
Author

IvanIsakof commented Nov 9, 2021

@Thom1729 Yes, of course! This is what I have installed at the moment:
[
('Babel', 'https://babeljs.io/'),
('Bash Build System', 'https://github.com/macite/sublimebashbuildsystem'),
('Color Highlight', 'https://github.com/Kronuz/ColorHighlight'),
('Diffy', 'https://github.com/zsong/diffy'),
('Emmet', 'https://emmet.io'),
('GraphQL', 'https://github.com/dncrews/GraphQL-SublimeText3'),
('Graql Syntax', 'https://github.com/graknlabs/graql_syntax_sublime'),
('Jade', 'https://github.com/davidrios/jade-tmbundle'),
('Package Control', 'https://packagecontrol.io'),
('ReactJS', 'https://github.com/facebookarchive/sublime-react'),
('Simple JSX', 'https://github.com/ccampbell/sublime-jsx'),
('SublimeLinter-eslint', 'https://github.com/SublimeLinter/SublimeLinter-eslint'),
('SyncedSidebarBg', 'https://github.com/aziz/SublimeSyncedSidebarBg'),
('Babel Snippets', 'https://babeljs.io'),
('HTML-CSS-JS Prettify', 'https://github.com/victorporof/Sublime-HTMLPrettify'),
('JSHint', 'https://github.com/uipoet/sublime-jshint'),
]

@Thom1729
Copy link
Contributor

Thom1729 commented Nov 9, 2021

Nothing seems like it would obviously conflict.

Can you run the following in the Sublime terminal and post the result?

sublime.find_syntax_by_scope('source.js.css')

@Thom1729
Copy link
Contributor

Thom1729 commented Nov 9, 2021

@IvanIsakof Just pinging you in case you missed my comment.

@IvanIsakof
Copy link
Author

@Thom1729 Yes, I am getting an empty array:
>>> sublime.find_syntax_by_scope('source.js.css')
[]

@Thom1729
Copy link
Contributor

That means that, somehow, the Styled Components syntax is not getting loaded. The only thing I can think of that would cause that is if you have the core CSS package set to ignored. Is that possible?

@IvanIsakof
Copy link
Author

@Thom1729 I don't think so. I have been working in sublime without adding packages or changing configuration for a long time. I get error after updating the sublime to a new build. Thank you for trying to help, later I will try to reinstall the sublime with all packages.

@bingqichen
Copy link

I have a same problem.

@Thom1729
Copy link
Contributor

Can you close and reopen Sublime, then copy-paste the console output here? There might be something in there explaining why the Styled Components syntax is not loading.

@bingqichen
Copy link

bingqichen commented Nov 15, 2021

@Thom1729 It's my log about the error, and my ST version is 'build 4121', running on macOS 12.0.1.

Error loading scope:source.js.css: Unable to find syntax file for scope "source.js.css" in Packages/Babel/JavaScript (Babel).sublime-syntax
error: Error loading syntax file "Packages/Babel/JavaScript (Babel).sublime-syntax": Packages/Babel/JavaScript (Babel).sublime-syntax: no such target scope:source.js.css#at-keyframe-block-content

@Thom1729
Copy link
Contributor

Is there any message about the Packages/Babel/Styled Components.sublime-syntax syntax? That's what provides the source.js.css scope.

@bingqichen
Copy link

@Thom1729 , it's nothing just like @IvanIsakof

>>> sublime.find_syntax_by_scope('source.js.css')
[]

@Thom1729
Copy link
Contributor

I mean, in the log messages when Sublime starts up, is there possibly a message about the Styled Components syntax like there is about the Babel syntax?

@bingqichen
Copy link

bingqichen commented Nov 15, 2021

OK, I provide the complete log messages from starts up, until open a javascript file. But i can't find that you want.

startup, version: 4121 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/sublime_text
application: /Applications/Sublime Text.app
working dir: /
packages path: /Users/ys/Library/Application Support/Sublime Text 3/Packages
state path: /Users/ys/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/ys/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["CSS", "JavaScript", "Vintage"]
pre session restore time: 0.630857
OpenGL Context Information:
  GL API Version: 4.1 INTEL-18.2.10
  GLSL Version: 4.10
  Vendor: Intel Inc.
  Renderer: Intel(R) Iris(TM) Plus Graphics 640
startup time: 0.848094
first paint time: 0.869779
git: using configuration from system git install
git: tracking working dir /Users/ys/company_project/qwb-light-h5
environment variables loaded using: /bin/zsh -l
reloading python 3.3 plugin 0_package_control_loader.00-package_control
reloading plugin Default.arithmetic
reloading python 3.3 plugin 0_package_control_loader.01-pygments
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading python 3.3 plugin 0_package_control_loader.10-shellenv
reloading python 3.3 plugin 0_package_control_loader.50-backrefs
reloading python 3.3 plugin 0_package_control_loader.50-markupsafe
reloading python 3.3 plugin 0_package_control_loader.50-pymdownx
reloading python 3.3 plugin 0_package_control_loader.50-python-markdown
reloading python 3.3 plugin 0_package_control_loader.50-pyyaml
reloading plugin Default.colors
reloading python 3.3 plugin 0_package_control_loader.51-python-jinja2
reloading python 3.3 plugin 0_package_control_loader.55-jsonschema
reloading python 3.3 plugin 0_package_control_loader.55-mdpopups
reloading python 3.3 plugin Babel.plugin
reloading python 3.3 plugin BracketHighlighter.bh_core
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin A File Icon.plugin
reloading plugin Emmet.main
reloading plugin LESS.less_completions
reloading plugin Sass.sass_completions
reloading plugin SideBarEnhancements.SideBar
reloading plugin SideBarEnhancements.SideBarAPI
reloading plugin SideBarEnhancements.SideBarDefaultDisable
reloading plugin StandardFormat.standard-format
reloading plugin ConvertToUTF8.ConvertToUTF8
reloading python 3.3 plugin BracketHighlighter.bh_logging
reloading python 3.3 plugin BracketHighlighter.bh_plugin
reloading python 3.3 plugin BracketHighlighter.bh_popup
reloading python 3.3 plugin BracketHighlighter.bh_regions
reloading python 3.3 plugin BracketHighlighter.bh_remove
reloading python 3.3 plugin BracketHighlighter.bh_rules
reloading python 3.3 plugin BracketHighlighter.bh_search
reloading python 3.3 plugin BracketHighlighter.bh_swapping
reloading python 3.3 plugin BracketHighlighter.bh_wrapping
reloading python 3.3 plugin BracketHighlighter.support
reloading python 3.3 plugin CSS3.css3_completions
reloading python 3.3 plugin CSS3.rgb_to_hex
reloading python 3.3 plugin DashDoc.DashDoc
reloading python 3.3 plugin DocBlockr.jsdocs
reloading python 3.3 plugin EditorConfig.EditorConfig
reloading python 3.3 plugin Package Control.1_reloader
reloading python 3.3 plugin Package Control.2_bootstrap
reloading python 3.3 plugin Package Control.Package Control
reloading python 3.3 plugin SublimeLinter-contrib-standard.linter
reloading python 3.3 plugin SublimeLinter.__init__
reloading python 3.3 plugin SublimeLinter._init
reloading python 3.3 plugin SublimeLinter.active_linters_view
reloading python 3.3 plugin SublimeLinter.busy_indicator_view
reloading python 3.3 plugin SublimeLinter.goto_commands
reloading python 3.3 plugin SublimeLinter.highlight_view
reloading python 3.3 plugin SublimeLinter.log_handler
reloading python 3.3 plugin SublimeLinter.message_view
reloading python 3.3 plugin SublimeLinter.panel_view
reloading python 3.3 plugin SublimeLinter.quick_actions
reloading python 3.3 plugin SublimeLinter.status_bar_view
reloading python 3.3 plugin SublimeLinter.sublime_linter
reloading python 3.3 plugin TerminalView.exec
reloading python 3.3 plugin TerminalView.gateone_terminal_emulator
reloading python 3.3 plugin TerminalView.linux_pty
reloading python 3.3 plugin TerminalView.pyte_terminal_emulator
reloading python 3.3 plugin TerminalView.sublime_terminal_buffer
reloading python 3.3 plugin TerminalView.sublime_view_cache
reloading python 3.3 plugin TerminalView.TerminalView
reloading python 3.3 plugin TerminalView.utils
reloading python 3.3 plugin JavaScript Enhancements.main
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 310, in reload_plugin
    load_module(m)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 343, in load_module
    decorate_handler(t, method_name)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 226, in decorate_handler
    method = cls.__dict__[method_name]
KeyError: 'on_activated'
plugins loaded
StandardFormat:
  global_path: /Users/ys/.pyenv/shims:/Users/ys/.pyenv/bin:/Users/ys/.rvm/gems/ruby-2.3.0/bin:/Users/ys/.rvm/gems/ruby-2.3.0@global/bin:/Users/ys/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ys/.rvm/gems/ruby-2.3.0/bin:/Users/ys/.rvm/gems/ruby-2.3.0@global/bin:/Users/ys/.rvm/rubies/ruby-2.3.0/bin:/Users/ys/.pyenv/shims:/Users/ys/.pyenv/bin:/usr/local/opt/[email protected]/bin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/ys/.nvm/versions/node/v16.13.0/bin:/Users/ys/.rvm/bin:/Users/ys/.rvm/bin
  search_path: /Users/ys/company_project/qwb-light-h5/node_modules/.bin:/Users/ys/.pyenv/shims:/Users/ys/.pyenv/bin:/Users/ys/.rvm/gems/ruby-2.3.0/bin:/Users/ys/.rvm/gems/ruby-2.3.0@global/bin:/Users/ys/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ys/.rvm/gems/ruby-2.3.0/bin:/Users/ys/.rvm/gems/ruby-2.3.0@global/bin:/Users/ys/.rvm/rubies/ruby-2.3.0/bin:/Users/ys/.pyenv/shims:/Users/ys/.pyenv/bin:/usr/local/opt/[email protected]/bin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/ys/.nvm/versions/node/v16.13.0/bin:/Users/ys/.rvm/bin:/Users/ys/.rvm/bin
  root_path: None
  found standard at /Users/ys/company_project/qwb-light-h5/node_modules/.bin/standard
  command: ['standard', '--stdin', '--fix']
Package Control: Skipping automatic upgrade, last run at 2021-11-15 10:23:58, next run at 2021-11-15 11:23:58 or after
Error loading scope:source.js.css: Unable to find syntax file for scope "source.js.css" in Packages/Babel/JavaScript (Babel).sublime-syntax
error: Error loading syntax file "Packages/Babel/JavaScript (Babel).sublime-syntax": Packages/Babel/JavaScript (Babel).sublime-syntax: no such target scope:source.js.css#at-keyframe-block-content

@Thom1729
Copy link
Contributor

Thom1729 commented Nov 15, 2021

Thanks.

ignored_packages: ["CSS", "JavaScript", "Vintage"]

This is the problem. The Babel syntax relies on the Styled Components syntax, which in turn relies on the core CSS syntax (as of v11). (I'm surprised that there is no separate error for the Styled Components syntax failing to load.)

The documentation doesn't explicitly mention that the core CSS package is required, and I should add that to the docs.

Is there a particular reason that you've disabled the core CSS package? Making the new Styled Components syntax work without the core CSS package disabled would be complicated, but if there's an real need for that then I can look into it.

If you didn't explicitly disable it yourself, then I wonder if one of the packages you have installed automatically disables the core CSS package. That would be a weird thing for a package to do, but I've seen weirder.

@bingqichen
Copy link

Thanks for your reply. Yeah, it's work well when I enable the CSS package. But i don't know why disable it, it happened a long time ago.

@bingqichen
Copy link

Hey, I found the reason that why i disable the default CSS package.

Because i use the CSS3. And the installation guide tell me disable it.

Thanks.

ignored_packages: ["CSS", "JavaScript", "Vintage"]

This is the problem. The Babel syntax relies on the Styled Components syntax, which in turn relies on the core CSS syntax (as of v11). (I'm surprised that there is no separate error for the Styled Components syntax failing to load.)

The documentation doesn't explicitly mention that the core CSS package is required, and I should add that to the docs.

Is there a particular reason that you've disabled the core CSS package? Making the new Styled Components syntax work without the core CSS package disabled would be complicated, but if there's an real need for that then I can look into it.

If you didn't explicitly disable it yourself, then I wonder if one of the packages you have installed automatically disables the core CSS package. That would be a weird thing for a package to do, but I've seen weirder.

@bingqichen
Copy link

@Thom1729 Hey, there has any update?☺️

@deathaxe
Copy link

Hey, I found the reason that why i disable the default CSS package.

Because i use the CSS3. And the installation guide tell me disable it.

Disabling default CSS syntax absolutely discouraged!

The way how syntax inheritance and embedding works, these days, it is no longer possible to use 3rd-party syntaxes such as CSS3 as drop-in replacement for ST's default CSS syntax, which is embedded in all sorts of templating syntax definitions.

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

4 participants