# Syntax error in line 1

**URL:** <https://forum.graphviz.org/t/syntax-error-in-line-1/1236>\
**Category:** Help\
**Created:** [June 30, 2022, 5:47am UTC](https://forum.graphviz.org/t/syntax-error-in-line-1/1236 "2022-06-30T05:47:17Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [October 3, 2022, 7:46pm UTC](https://forum.graphviz.org/t/syntax-error-in-line-1/1236/21 "2022-10-03T19:46:47Z")

</div>

You could also try

`dot -Tsvg TerraformGraph20220930.dot -o TerraformGraph20220930.svg`

I’m wary of side-effects in redirection in the Windows shell(s).

---

<div class="post-metadata">

**Author:** ![abdulrehman](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@abdulrehman](https://forum.graphviz.org/u/abdulrehman)\
**Post date:** [December 26, 2023, 5:02pm UTC](https://forum.graphviz.org/t/syntax-error-in-line-1/1236/22 "2023-12-26T17:02:55Z")

</div>

Hi, Its Dec 2023  
I encountered this error in my Windows PC while running on PowerShell  
PS C:\Terraform\> terraform graph | dot -Tpng \> graph.png  
Error: : syntax error in line 1 near ‘﻿digraph’

Turns Out that file named by graph.dot in the folder is being saved automatically in UTF-8-BOM  
So the solution is  
1- Run this command → terraform graph  
2- Open the graph.dot file (it is created in the directory you run command) in Notepad++  
3- Go to Encoding and change it settings to UTF-8 and save it.  
4- Run this command → dot -Tpng graph.dot -o TerraformGraphNew.png

Hope it helps

[Previous page](https://forum.graphviz.org/t/syntax-error-in-line-1/1236.md?page=1)
