question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building Syntaxes Failing with Latest Version

See original GitHub issue

JSCustom recently updated to v4.2.1 (right after updating Sublime to build 4121) and now the syntaxes build fails. Removing the package and reinstalling doesn’t help.

Here’s the error message I’m getting after rebuilding syntaxes using the default config:

Building JS Custom.sublime-syntax.yaml-macros... (/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros)

Error in macro execution.
  in "<unicode string>", line 4, column 1:
    !apply
    ^ (line: 4)
{'name': 'JS Custom - Default', 'jsx': False, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_template_tags': False, 'scope': 'source.js.default', 'flow_types': False}

Error in macro execution.
  in "<unicode string>", line 6, column 5:
      - !get_extensions
        ^ (line: 6)
{'name': 'JS Custom - Default', 'jsx': False, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_template_tags': False, 'scope': 'source.js.default', 'flow_types': False}

Traceback (most recent call last):
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/custom_constructor.py", line 31, in macro_constructor
    return macro(loader, node)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/get_macro.py", line 51, in macro
    result = apply(function, args)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/util.py", line 27, in apply
    return fn(**fix_keywords(args))
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Installed Packages/JSCustom.sublime-package/src/syntax/macros.py", line 19, in get_extensions
    name for name, options in configuration.items()
AttributeError: 'NoneType' object has no attribute 'items'

[Failed in 1.03 seconds.]

Building JS Custom.sublime-syntax.yaml-macros... (/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros)

Error in macro execution.
  in "<unicode string>", line 4, column 1:
    !apply
    ^ (line: 4)
{'typescript': True, 'name': 'JS Custom - TypeScript', 'jsx': False, 'custom_template_tags': False, 'scope': 'source.ts', 'flow_types': False, 'file_extensions': ['ts'], 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros'}

Error in macro execution.
  in "<unicode string>", line 6, column 5:
      - !get_extensions
        ^ (line: 6)
{'typescript': True, 'name': 'JS Custom - TypeScript', 'jsx': False, 'custom_template_tags': False, 'scope': 'source.ts', 'flow_types': False, 'file_extensions': ['ts'], 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros'}

Traceback (most recent call last):
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/custom_constructor.py", line 31, in macro_constructor
    return macro(loader, node)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/get_macro.py", line 51, in macro
    result = apply(function, args)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/util.py", line 27, in apply
    return fn(**fix_keywords(args))
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Installed Packages/JSCustom.sublime-package/src/syntax/macros.py", line 19, in get_extensions
    name for name, options in configuration.items()
AttributeError: 'NoneType' object has no attribute 'items'

[Failed in 1.13 seconds.]

Building JS Custom.sublime-syntax.yaml-macros... (/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros)

Error in macro execution.
  in "<unicode string>", line 4, column 1:
    !apply
    ^ (line: 4)
{'file_extensions': ['js', 'jsx'], 'name': 'JS Custom - React', 'jsx': True, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_template_tags': False, 'scope': 'source.js.react', 'flow_types': True}

Error in macro execution.
  in "<unicode string>", line 6, column 5:
      - !get_extensions
        ^ (line: 6)
{'file_extensions': ['js', 'jsx'], 'name': 'JS Custom - React', 'jsx': True, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_template_tags': False, 'scope': 'source.js.react', 'flow_types': True}

Traceback (most recent call last):
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/custom_constructor.py", line 31, in macro_constructor
    return macro(loader, node)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/get_macro.py", line 51, in macro
    result = apply(function, args)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/util.py", line 27, in apply
    return fn(**fix_keywords(args))
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Installed Packages/JSCustom.sublime-package/src/syntax/macros.py", line 19, in get_extensions
    name for name, options in configuration.items()
AttributeError: 'NoneType' object has no attribute 'items'

[Failed in 1.00 seconds.]

Building JS Custom.sublime-syntax.yaml-macros... (/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros)

Error in macro execution.
  in "<unicode string>", line 4, column 1:
    !apply
    ^ (line: 4)
{'name': 'JS Custom (Embedded)', 'jsx': False, 'custom_template_tags': False, 'scope': 'source.js', 'flow_types': False, 'file_extensions': [], 'hidden': True, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_templates': False}

Error in macro execution.
  in "<unicode string>", line 6, column 5:
      - !get_extensions
        ^ (line: 6)
{'name': 'JS Custom (Embedded)', 'jsx': False, 'custom_template_tags': False, 'scope': 'source.js', 'flow_types': False, 'file_extensions': [], 'hidden': True, 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros', 'custom_templates': False}

Traceback (most recent call last):
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/custom_constructor.py", line 31, in macro_constructor
    return macro(loader, node)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/get_macro.py", line 51, in macro
    result = apply(function, args)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/util.py", line 27, in apply
    return fn(**fix_keywords(args))
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Installed Packages/JSCustom.sublime-package/src/syntax/macros.py", line 19, in get_extensions
    name for name, options in configuration.items()
AttributeError: 'NoneType' object has no attribute 'items'

[Failed in 1.07 seconds.]

Building JS Custom.sublime-syntax.yaml-macros... (/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros)

Error in macro execution.
  in "<unicode string>", line 4, column 1:
    !apply
    ^ (line: 4)
{'typescript': True, 'name': 'JS Custom - TypeScript (JSX)', 'jsx': True, 'custom_template_tags': False, 'scope': 'source.tsx', 'flow_types': False, 'file_extensions': ['tsx'], 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros'}

Error in macro execution.
  in "<unicode string>", line 6, column 5:
      - !get_extensions
        ^ (line: 6)
{'typescript': True, 'name': 'JS Custom - TypeScript (JSX)', 'jsx': True, 'custom_template_tags': False, 'scope': 'source.tsx', 'flow_types': False, 'file_extensions': ['tsx'], 'file_path': '/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/JSCustom/src/syntax/JS Custom.sublime-syntax.yaml-macros'}

Traceback (most recent call last):
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/custom_constructor.py", line 31, in macro_constructor
    return macro(loader, node)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/get_macro.py", line 51, in macro
    result = apply(function, args)
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Packages/yaml_macros_engine/st3/yamlmacros/src/util.py", line 27, in apply
    return fn(**fix_keywords(args))
  File "/Users/nwoltman/Library/Application Support/Sublime Text 3/Installed Packages/JSCustom.sublime-package/src/syntax/macros.py", line 19, in get_extensions
    name for name, options in configuration.items()
AttributeError: 'NoneType' object has no attribute 'items'

[Failed in 1.01 seconds.]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Thom1729commented, Nov 5, 2021

Those are some pretty wild errors. It looks like there was some kind of problem with Sublime reading the package files. Whatever the root cause was, I suspect it had something to do with the fact that Python isn’t really designed for hot module reloading. If restarting Sublime fixed it, then I’m not overly concerned.

If the problem recurs, feel free to repoen.

0reactions
nwoltmancommented, Nov 4, 2021

Can you run the following in the Python 3.3 console and paste the result?

import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))

This is what I get when I run that in the console:

>>> import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
import JSCustom.src.configurations; JSCustom.src.configurations.get_configurations(sublime.load_settings('JS Custom.sublime-settings'))
Traceback (most recent call last):
  File "__main__", line 1, in <module>
ModuleNotFoundError: No module named 'JSCustom'

After trying to rebuild syntaxes and then opening the Python console, here’s what I’m seeing:

[JS Custom] Building configuration Default…
[JS Custom] Building configuration TypeScript…
error parsing lexer: Packages/User/JS Custom/Syntaxes/Default.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/Default.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/React.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/React.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax:1:1
generating syntax summary
error: Error loading syntax file "Packages/User/JS Custom/Syntaxes/Default.sublime-syntax": Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/Default.sublime-syntax:1:1
[JS Custom] Building configuration React…
[JS Custom] Building configuration ~embed…
[JS Custom] Building configuration TypeScript (JSX)…
error parsing lexer: Packages/User/JS Custom/Syntaxes/Default.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/Default.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/React.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/React.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax:1:1
generating syntax summary
indexing [job 61]: no files were indexed out of the 4096 queued, abandoning crawl
error parsing lexer: Packages/User/JS Custom/Syntaxes/Default.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/Default.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/React.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/React.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript.sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/TypeScript (JSX).sublime-syntax:1:1
error parsing lexer: Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax: Error trying to parse sublime-syntax: %YAML indicator is required in Packages/User/JS Custom/Syntaxes/~embed.sublime-syntax:1:1
generating syntax summary

Although update: It’s building just fine now. Fully closing Sublime and restarting fixed it. I guess I hadn’t quit Sublime or restarted my computer in a few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm run build fails with a syntax error · Issue #176 - GitHub
I'm running node v4.3.2, installed via nvm. I did a npm install, it complained that babel and cover prefers global, I then installed...
Read more >
npm run build fails with: Syntax Error: TypeError: Cannot read ...
After trying to get a simple authentification site working, my npm run build fails with this message: ERROR Failed to compile with 1...
Read more >
Common Build Problems - Travis CI Docs
My build fails unexpectedly #​​ One possible cause for builds failing unexpectedly can be calling set -e (also known as set errexit ),...
Read more >
Building DB Package failing with syntax error - Redgate forums
We are using TeamCity 10.0.1 with the latest plugin installed. I also updated our DLM Environment to the absolute latest version this ...
Read more >
Why is the build process failing with error code: "NMAKE: fatal ...
1. Open a Windows Command Prompt. · 2. Create the symbolic link to the location where your MATLAB versions are installed. · 3....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found