AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

​self-host version, error message is displayed during use: GraphQLError: Cannot query field "copilot" on type "UserType"

Open KingPop opened this issue 1 year ago • 1 comments

What happened?

After the self-host version is deployed in the on-premises environment, check the exception log information and find the following error message: image

Please, does it affect functionality? How should I fix it

Distribution version

Linux

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • [ ] Yes

Relevant log output

No response

Anything else?

No response

KingPop avatar Nov 24 '24 02:11 KingPop

the errors are reasoned by frontend did't follow server's Copilot feature. it won't affect any existing components.

forehalo avatar Nov 27 '24 07:11 forehalo

When will you fix this? I really want to use Copilot on Selfhost version. It use to work a few months ago.

Update: I found the way. I edit wrong affine.js file. I need to edit /app/dist/config/affine.js to work.

kunthawat avatar Dec 29 '24 10:12 kunthawat

@kunthawat Thank you this solution works. However, it's weird that we have to edit a file in the dist directory (which is presumably rebuilt every time we have to update the container) instead of using the path in the AFFINE_CONFIG_PATH variable like before. I also still don't understand why we can't just define the Open AI key using an environment variable like everything else...

It's also worth noting that the affine.js file has changed a bit with the newer version and it caused mine to be outdated, but it doesn't seem to be mentioned anywhere in the documentation.

YummYume avatar Jan 01 '25 20:01 YummYume

@YummYume I'm lucky that I found a clue in discord. BTW the affine.js in old location used to work with old version. I think the team may fix this issue soon.

kunthawat avatar Jan 02 '25 01:01 kunthawat