Moving class to package triggers errors about main actor-isolated property?

My Swift is rusty; it's been a while. I tried to copy some existing, working code to a Swift package, and these errors started showing up.

/.../ScannerViewController.swift:101:23 Main actor-isolated property 'captureSession' can not be referenced from a Sendable closure

Any idea why this was compiling before, but then moving the class to a package triggers this error? I also had to add some public keywords to the class and methods, but otherwise I changed nothing.

Relevant snippets of class:

public class ScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
    var captureSession: AVCaptureSession!

    override public func viewDidLoad() {
        ...
        DispatchQueue.global(qos: .userInitiated).async { [weak self] in
            self?.captureSession.startRunning()
        }

Probably, your main codebase configured within Swift 5, and newly created package has been set to 6.0 version of Swift, enabling all concurrency checks. You can alter mode in package settings in order to run it with Swift 5 mode: Documentation

Neither of these new lines seem to do it. Do they look correct?

let package = Package(
    ...
    targets: [
        .target(
            name: "Foo",
            swiftSettings: [
                .swiftLanguageMode(.v5)  // added
            ]
        ),
        .testTarget(
            name: "FooTests",
            dependencies: ["Foo"]
        ),
    ],
    swiftLanguageModes: [.v5]  // added