Skip to content

Server queries crash on /product/<id>: stale loader-bundle-env install pairs old @plasmicapp/data-sources with new codegen #397

Description

@field123

examples/ep-commerce-app-router does not render. After a clean yarn install from its lockfile, every page returns 500. This blocks using it to validate the 0.2.0 release.

Current state (2026-08-06, master 96b12239d)

Package installed /products /product/<real-id> Error
published 0.0.3 (from lockfile) 500 500 Error executing server queries function TypeError: Cannot read properties of undefined (reading 'state') + TypeError: Cannot read properties of null (reading 'useContext')
master build over clean tree 500 500 Cannot find module '.../node_modules/next/server' imported from .../dist/server.mjs

Two separate problems

1. The lockfile pins a package three months behind the example's source. package.json asks for *, the lockfile resolves 0.0.3, and the example's own code has since moved on with master (createBetterEpAuth, hostAllowlist, and so on). The useContext null is consistent with that mismatch rather than with a React duplicate — only one React 19.2.5 is installed.

2. The ESM /server entry may not resolve. See the handoff / separate investigation. dist/server.mjs imports the bare specifier next/server, and Next 15.5.15 ships no exports field, so only legacy CJS lookup can resolve it. Unconfirmed whether this affects real consumers or only this local setup.

Also worth knowing

  • Before the clean install, the tree carried three copies of @plasmicapp/host (2.0.1, 1.0.233, 1.0.240) and Plasmic warned Encountered likely duplicate host version. That produced a duplicated function registry (16 entries for 8 functions) and an execParams crash. All of it disappeared after the clean install — it was local rot, partly self-inflicted by hand-copying builds into node_modules. Recorded here only so the symptoms are recognisable if they recur.
  • EP_CLIENT_SECRET is unset in the local .env.local, so checkout's admin paths (Stripe registration, server-computed money) stay disabled regardless of the above.

Suggested first step

Decide what the example should build against — the published package or the workspace source — and make the lockfile say so. Much of the confusion above comes from it being neither.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions