javascript icon indicating copy to clipboard operation
javascript copied to clipboard

[NUXT] Publishable key is missing.

Open AleexMzz opened this issue 1 year ago • 2 comments

Preliminary Checks

  • [x] I have reviewed the documentation: https://clerk.com/docs

  • [x] I have searched for existing issues: https://github.com/clerk/javascript/issues

  • [x] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)

  • [x] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.

Reproduction

https://github.com/clerk/clerk-nuxt-quickstart

Publishable key

pk_test_ZW5qb3llZC1yb29zdGVyLTM0LmNsZXJrLmFjY291bnRzLmRldiQ

Description

[nuxt] [request error] [unhandled] [500] Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys

Steps to reproduce:

  1. Put identifiers in .env
  2. Run npm run build
  3. Run node .output/server/index.mjs

Expected behavior: The application is launched

Actual behavior: An error : Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 18.79 GB / 31.91 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.3.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.4 - ~\AppData\Roaming\npm\pnpm.CMD
    bun: 1.2.2 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (127.0.2651.105)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    axios: ^1.7.9 => 1.7.9
    dotenv: ^16.4.7 => 16.4.7
    md5-file: ^5.0.0 => 5.0.0

AleexMzz avatar Feb 28 '25 17:02 AleexMzz

Hello! This is Nuxt's default behavior. See https://nuxt.com/docs/guide/directory-structure/env#production

You need to explicitly set the environment variables

CLERK_PUBLISHABLE_KEY=pk_ CLERK_SECRET_KEY=sk_ node .output/server/index.mjs

wobsoriano avatar Mar 01 '25 01:03 wobsoriano

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar May 28 '26 00:05 github-actions[bot]