Skip to content

[BUG]: Cannot find module 'varlock', on Vercel #584

@violabg

Description

@violabg

varlock version

0.7.2

Steps to reproduce

My app is using varlock with pass, I have deployed on vercel and it was working fine, but now after some code updates not related to varlock is giving me and error.
Locally testing with the build is working fine.

next.config.ts

import { varlockNextConfigPlugin } from "@varlock/nextjs-integration/plugin";
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    viewTransition: true,
  },
  images: {
    dangerouslyAllowSVG: true,
    contentDispositionType: "attachment",
    contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
  },
}

export default varlockNextConfigPlugin()(nextConfig);

package.json

{
  "name": "ai-talks",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint"
  },
  "dependencies": {
    "@base-ui/react": "^1.3.0",
    "@tailwindcss/typography": "^0.5.19",
    "@upstash/redis": "^1.37.0",
    "@varlock/nextjs-integration": "^0.3.3",
    "@varlock/pass-plugin": "^0.0.6",
    "better-auth": "^1.6.2",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "geist": "^1.7.0",
    "github-slugger": "^2.0.0",
    "gray-matter": "^4.0.3",
    "lucide-react": "^1.8.0",
    "motion": "^12.38.0",
    "next": "16.2.3",
    "next-mdx-remote": "^6.0.0",
    "next-themes": "^0.4.6",
    "react": "19.2.5",
    "react-dom": "19.2.5",
    "rehype-autolink-headings": "^7.1.0",
    "rehype-pretty-code": "^0.14.3",
    "rehype-slug": "^6.0.0",
    "remark-gfm": "^4.0.1",
    "shadcn": "^4.2.0",
    "tailwind-merge": "^3.5.0",
    "tw-animate-css": "^1.4.0",
    "varlock": "^0.7.2"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4.2.2",
    "@types/github-slugger": "^2.0.0",
    "@types/mdx": "^2.0.13",
    "@types/node": "^25.6.0",
    "@types/react": "^19.2.14",
    "@types/react-dom": "^19.2.3",
    "eslint": "^9.39.4",
    "eslint-config-next": "16.2.3",
    "tailwindcss": "^4.2.2",
    "typescript": "^6.0.2"
  },
  "overrides": {
    "next": {
      "@next/env": "npm:@varlock/nextjs-integration"
    },
    "other-dep": {
      "dotenv": "npm:varlock"
    }
  }
}

What is expected?

to work on Vercel

What is actually happening?

error on Vercel log when trying to access the site

2026-04-10 15:37:36.638 [error] Cannot find module 'varlock'
Require stack:

  • /var/task/node_modules/@next/env/dist/next-env-compat.js
  • /var/task/___next_launcher.cjs
    Did you forget to add it to "dependencies" in package.json?
    Node.js process exited with exit status: 1. The logs above can help with debugging the issue.

System Info

Any additional comments?

I'm not sure if is a vercel problem since I have deployed an older version that was working and now is giving the same error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions