@trpc/server in a non-server environment Error in Azure CI
Im trying to add vitest unit tests for my trpc procedures. I followed some examples and on the local evn all works. Tests pass but in the Azure CI I get this error.
4 Replies
You've probably imported your Backend into the Frontend
Make sure where you're importing the AppRouter you're doing
import type { AppRouter } from 'backend'
Or you just need to set up your tests project to include the Node environment, it may be browser by defaultmmm this might be it but why it works locally then
Sometimes the mode of tools changes when CI=1 is set in the environment. This would be a weird case of that though
@Nick Lucas Thanks for the tip! You were right. I've changed default setting for vitest from environment: 'jsdom', to per file via comment and it worked ❤️