Swift Replit will never run if after forking it you change its name

Bug description:
When forking a Swift replit, if you change the replit name, it will never run again successfully because it looks for the cache of the old replit name.

<unknown>:0: error: PCH was compiled with module cache path '/home/runner/mac-interview-candidate-version-1/.cache/clang/ModuleCache/QS0TP6CXX1XV', but the path is currently '/home/runner/mac-interview-candidate-version-Task3/.cache/clang/ModuleCache/QS0TP6CXX1XV'
<unknown>:0: error: missing required module 'SwiftShims'

I also tried to delete the .cache folder, but that was an even worse idea. After that, building the application no longer did anything, because it said swiftc is not found in $path.

Expected vs Current Behavior:
Expected: The replit name can be changed, and cache location will be updated.
Current: Changing the replit name corrupts the application forever.

Steps to reproduce:

  1. Fork a swift replit
  2. Change its name
  3. The replit cannot be run anymore.

Browser/OS/Device: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Replit Profile: https://replit.com/@balazserdesz

The solution is to delete the ModuleCache folder from shell:

rm -rf /path/to/ModuleCache

instead of .cache with rm -rf /path/to/.cache.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.