Skip to content

[Bug]: "<A ..." triggers ERROR Client-only API called on the server side. under vinix build but not npm run build #1862

@jcalfee

Description

@jcalfee
$ vinxi build && vinxi start
...
 ERROR  Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.                                               6:56:47 PM

  at notSup (.output/server/node_modules/solid-js/web/dist/server.js:1141:9)
  at .output/server/chunks/runtime.mjs:8590:10
  at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
  at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
  at async Object.run (/home/james/.local/share/pnpm/global/5/.pnpm/vinxi@0.4.3_@types+node@22.4.1_ioredis@5.4.1_terser@5.31.6/node_modules/vinxi/bin/cli.mjs:278:7)
  at async runCommand (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:316:16)
  at async runCommand (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:307:11)
  at async runMain (/home/james/.local/share/pnpm/global/5/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs:445:7) 

Image

Expected behavior 🤔

vinxi build and vinxi start should work just like package.json:

"scripts": {
    "build": "vinxi build",
    "start": "vinxi start"
  },

OR log a warning or error..

Steps to reproduce 🕹

Steps:

  1. https://docs.solidjs.com/solid-start/getting-started
  2. Edit src/app.tsx and change <a href="/">Index</a> to <A href="/">Index</A>, add import
  3. vinxi build && vinxi start # builds but crashes when it goes to start
  4. npm run build && npm run start # everything works

Context 🔦

Get rid of an incredible difficult bug to find.

Your environment 🌎

Pop!_OS 22.04 LTS
node v22.14.0
@solidjs/start@1.1.3

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions