Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.0.0 Alpha] 'Sendable' class 'JavaScriptError' cannot inherit from another class other than 'NSObject' #2146

Closed
TizianoCoroneo opened this issue Feb 9, 2022 · 26 comments · Fixed by #2147
Assignees
Labels
alpha-feedback beta-xcode Issues occurring on a beta version of Xcode

Comments

@TizianoCoroneo
Copy link
Contributor

Bug report

I'm trying out the new alpha version for v1.0.0 using Xcode 13.3 beta. I encountered this error while trying to run the codegen using Swift Scripting.

Versions

Please fill in the versions you're currently using:

  • apollo-ios SDK version: v1.0.0-alpha-1
  • Xcode version: 13.3 beta 1
  • Swift version: 5.6
  • Package manager: SPM

Steps to reproduce

Try to run a Swift Scripting setup of the Apollo codegen.

Screen Shot 2022-02-09 at 12 20 22

@calvincestari
Copy link
Member

Thanks for digging into the alpha so quickly @TizianoCoroneo and for the PR, much appreciated.

@calvincestari calvincestari added beta-xcode Issues occurring on a beta version of Xcode alpha-feedback labels Feb 9, 2022
@Jerrot
Copy link

Jerrot commented Feb 9, 2022

The issue already exists on v0.5.0 with Xcode 13.3 beta 1.

@calvincestari
Copy link
Member

@Jerrot - this is now fixed in main, it will go out in release 0.51.0 if you need a tagged release.
@TizianoCoroneo - I've also merged main into release/1.0 so the alpha has the fix too.

@Jerrot
Copy link

Jerrot commented Feb 11, 2022

Great, thanks @calvincestari and @TizianoCoroneo as well.

@deepcodingios
Copy link

I could see this error getting resolved but I am facing "Missing package product 'ApolloCore'" error now.

@andyBettis
Copy link

I'm seeing this issue with Xcode 13.3 (13E113) using 0.41.0. If I move up to 0.51.0 I get a whole bunch of errors. Any advice?

@TimoWaelischIdealo
Copy link

TimoWaelischIdealo commented Mar 25, 2022

I'm seeing this issue with Xcode 13.3 (13E113) using 0.41.0. If I move up to 0.51.0 I get a whole bunch of errors. Any advice?

The latest release is 0.51.2, maybe try that first. Works just fine here with Xcode 13.3.

@calvincestari
Copy link
Member

@andyBettis it really depends on what those errors are. There are a lot of breaking changes between 0.41.0 and 0.51.0.

@andyBettis
Copy link

Yes, all sorted, I just had to follow the changes. Thanks for your help.

@jwoodard4-chwy
Copy link

I am still getting this issue after upgrading to 0.51.2 and I'm using Xcode 13.3. What is causing this?

error: 'Sendable' class 'JavaScriptError' cannot inherit from another class other than 'NSObject'

@calvincestari
Copy link
Member

I'm really not sure @jwoodard4-chwy. Take a look at the code in your dependency version of apollo-ios/Sources/ApolloCodegenLib/Frontend/JavaScriptBridge.swift. Verify that you've got @unchecked Sendable in the definition of JavaScriptError.

@strahinja-mem
Copy link

strahinja-mem commented May 11, 2022

I am still getting this issue after upgrading to 0.51.2 and I'm using Xcode 13.3. What is causing this?

error: 'Sendable' class 'JavaScriptError' cannot inherit from another class other than 'NSObject'

I'm having the same problem here. I did check JavaScriptBridge.swift and I do have @unchecked Sendable.

@calvincestari
Copy link
Member

Are you able to replicate this in a standalone sample project you could share with me? I'm not able to reproduce the error on the latest version.

@donnywdavis
Copy link

donnywdavis commented May 11, 2022

We just updated to from version 0.39.0 to 0.51.2 and I am seeing this error now. We are still using Xcode 13.1. The weird thing for us, is that I only see this error in our CI environment, but everything works fine locally. 🤔

One thing to note is that we are using the Codegen Package Template to handle the schema download and codegen scripts.

Update:
Turns out the fix for me was to update the Apollo CLI node package to the latest version of 2.33.11. Once I did that then everything started working again.

@jwoodard4-chwy
Copy link

jwoodard4-chwy commented May 11, 2022 via email

@strahinja-mem
Copy link

We just updated to from version 0.39.0 to 0.51.2 and I am seeing this error now. We are still using Xcode 13.1. The weird thing for us, is that I only see this error in our CI environment, but everything works fine locally. 🤔

One thing to note is that we are using the Codegen Package Template to handle the schema download and codegen scripts.

Update: Turns out the fix for me was to update the Apollo CLI node package to the latest version of 2.33.11. Once I did that then everything started working again.

Isn't the latest version 2.33.04? I still have this error, tried everything from this post.

@calvincestari
Copy link
Member

The latest release is 2.34.0 however apollo-ios is pinned to use 2.33.9.

@strahinja-mem it would be worth it to try again removing any interim build, I've found that to be the most problematic.

@strahinja-mem
Copy link

The latest release is 2.34.0 however apollo-ios is pinned to use 2.33.9.

@strahinja-mem it would be worth it to try again removing any interim build, I've found that to be the most problematic.

Sure, I can try that - What do you mean by interim build?

@calvincestari
Copy link
Member

The prebuilt artifacts that the compiler uses to speed up compilations between builds. In an Xcode project these are probably in the DerivedData folder and on an SPM project they're in the .build/ and .swiftpm/ folders.

@strahinja-mem
Copy link

I delete /DerivedData at least once a month, and I did try removing ~/Library/Caches/org.swift.swiftpm/ now, unfortunately, no luck. 😕

@calvincestari
Copy link
Member

What about in the root of the folder where the Package.swift file is? There should be .build and .swiftpm folders in there too.

@strahinja-mem
Copy link

I don't see those, tried searching too.

Screenshot 2022-06-19 at 7 35 35 PM

@calvincestari
Copy link
Member

@strahinja-mem are you able to replicate this build error in a new standalone project?

@strahinja-mem
Copy link

I tried running the same project on a different Mac, and it worked, so yeah, this has something to do with my cache. The question is, which cache since I tried both reinstalling the Xcode and re-cloning the repo. 🤔

@ahaTB
Copy link

ahaTB commented Jun 29, 2022

@strahinja-mem Any updates on this issue?

@strahinja-mem
Copy link

No unfortunately, I still run the script from my older Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha-feedback beta-xcode Issues occurring on a beta version of Xcode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants