Weird Vercel behavior.

hi! I'm trying to figure out why Vercel is losing it's mind about me using telemetry & the 'server-only' package together. I get the following error on build once it makes it to vercel:
/src/server/queries/users.ts:2:1
Module not found: Can't resolve 'server only'
1 | import { auth } from '@clerk/nextjs/server';
> 2 | import 'server only';
| ^
3 | import { db } from '../db';
4 |
5 | export function getAllUsers() {
/src/server/queries/users.ts:2:1
Module not found: Can't resolve 'server only'
1 | import { auth } from '@clerk/nextjs/server';
> 2 | import 'server only';
| ^
3 | import { db } from '../db';
4 |
5 | export function getAllUsers() {
It's in my package.json and I know that Vercel supports it. Am I doing something wrong here?
Solution:
it's server-only, not server only
Jump to solution
3 Replies
Solution
Matvey
Matvey6mo ago
it's server-only, not server only
Matvey
Matvey6mo ago
npm packages can't have spaces in the names
Parker
ParkerOP6mo ago
🤦‍♂️ thank you sir.
Want results from more Discord servers?
Add your server