SwiftDocOrg / swift-doc

A documentation generator for Swift projects
https://swiftdoc.org
MIT License
1.68k stars 100 forks source link

`Error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax` #303

Closed spnkr closed 2 years ago

spnkr commented 3 years ago

when i run swift doc generate path/to/source --module-name FancyModule i get this error.

> swift --version
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0
xcode-select -p        
/Applications/Xcode.app/Contents/Developer

/Applications/Xcode.app/Contents/Developer/Version.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>BuildAliasOf</key>
    <string>IDEFrameworks</string>
    <key>BuildVersion</key>
    <string>3</string>
    <key>CFBundleShortVersionString</key>
    <string>12.5</string>
    <key>CFBundleVersion</key>
    <string>18205</string>
    <key>ProductBuildVersion</key>
    <string>12E262</string>
    <key>ProjectName</key>
    <string>IDEFrameworks</string>
    <key>SourceVersion</key>
    <string>18205000000000000</string>
</dict>
</plist>
spnkr commented 2 years ago

xcode tool versions where this happens:

xcodebuild -version Xcode 12.5.1 Build version 12E507

swift --version Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57) Target: x86_64-apple-darwin20.4.0

swift-doc --version 1.0.0-rc.1

xcode-select -p
/Applications/Xcode.app/Contents/Developer

spnkr commented 2 years ago

removing and re-installing fixed this:

brew install swiftdocorg/formulae/swift-doc

and then choosing overwrite when asked by homebrew