Search Issue Tracker

Fixed in 13.1.0



Found in [Package]


Issue ID




[ShaderGraph] "Parse error: syntax error TOK_SHADER expected $end" error appears after adding too many Keywords

Package: Shader Graph


How to reproduce:
1. Open the user's attached project
2. In the Project browser, open the error SubGraph
3. In the Blackboard, add new Keyword/Enum property
4. Observe the error text (if it's correct, continue to step #5)
5. Delete the added Enum property

Expected result: error text: "Parse error: syntax error TOK_SHADER expected $end" and some Nodes still have errors
Actual result: error text is specific and there are no errors after deleting the added Enum property

Reproducible with: 8.3.1, 10.6.0 (2020.3.15f2), 11.0.0 (2021.1.17f1), 12.0.0 (2021.2.0b7)
Not reproducible with: 7.7.1 (2019.4.29f1), 8.2.0 (2020.3.15f2)

1. With 8.3.1, 10.3.2 (2020.3.15f2), 11.0.0 (2021.1.17f1) error is correct when adding Keyword but after deleting it errors on some Nodes stay and are incorrect
2. With 10.4.0, 10.6.0 (2020.3.15f2), 12.0.0 (2021.2.0b7, 2022.1.0a5) error is incorrect when adding Keyword but after deleting it the errors disappear
3. Errors disappear after reopening the SubGraph window
4. Expected error text:
"Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants or increase the Shader Variant Limit in Preferences > Shader Graph."

  1. Resolution Note (fix version 13.1.0):

    When too many variants are used, the blackboard will now display a help box with instructions for how to address the issue. Node previews will no longer get a badge with an error message.

    Fixed in 13.1.0 (2022.1.0a13)

Comments (2)

  1. kolsuzgamestudio

    Oct 25, 2021 22:38

    But first, increase the Shader Variant Limit in Preferences > Shader Graph about 300-400-500 or more.

  2. kolsuzgamestudio

    Oct 25, 2021 22:18

    in Unity 2020.3.12f1 LTS, getting this error after adding Keywords/Enum. after deleting the added, Parse error gone and previewing properly. After update to 2020.3.21f1 LTS still getting errors.

    To fix:
    frequently one of the node is custom function that contains many keywords. If so, delete this node from the master/or parent node, try to declare your Enums check still getting some errors, if not, add your deleted subgraph/custom function and connect them.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.