Shopify-AI-Toolkit icon indicating copy to clipboard operation
Shopify-AI-Toolkit copied to clipboard

shopify-liquid skill validate.mjs fails because package-lock.json resolves to private npm.shopify.io registry

Open MikeNewXYZ opened this issue 7 months ago • 3 comments

Summary

validate.mjs can't run because required @shopify/theme-check-* dependencies are missing at runtime, and npm install fails because package-lock.json resolves those packages to Shopify's private registry.

Steps to reproduce

  1. Install plugin via Claude Code marketplace
  2. Trigger the shopify-liquid skill
  3. Skill runs validate.mjs, which fails

What it looks like in Claude Code

The skill instructs the AI to validate every code block via validate.mjs. This is what happens:

⏺ Bash(cd skills/shopify-liquid && node scripts/validate.mjs --filename test.liquid --filetype sections --code '...')
  ⎿  Exit code 1
     Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@shopify/theme-check-common'

The AI then tries npm install to fix it, which also fails, creating a loop of broken validation attempts.

Actual behavior

$ node scripts/validate.mjs --filename test.liquid --filetype sections --code '<div>test</div>'

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@shopify/theme-check-common'
    imported from skills/shopify-liquid/scripts/validate.mjs

npm install also fails:

$ cd skills/shopify-liquid && npm install

npm error code E401
npm error Incorrect or missing password.

package-lock.json points all @shopify/* packages to the private registry:

@shopify/theme-check-node@https://npm.shopify.io/node/...
@shopify/theme-check-common@https://npm.shopify.io/node/...
@shopify/liquid-html-parser@https://npm.shopify.io/node/...
@shopify/theme-check-docs-updater@https://npm.shopify.io/node/...

MikeNewXYZ avatar Apr 10 '26 10:04 MikeNewXYZ

I can reproduce the missing dependency problem with the official Shopify plugin for Codex.

Environment:

  • Codex Desktop on Windows
  • Node.js v24.14.0
  • Installed with: codex plugin add shopify@openai-curated
  • Curated plugin manifest version: 1.3.3
  • Shopify skill version: 1.9.1
  • Managed snapshot: 2f1a8948

Running the Liquid validator from the clean managed-plugin installation fails with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@shopify/theme-check-common'

The installed skill contains its package.json, but the required runtime packages are not included or hydrated in the managed plugin cache.

I copied only the Liquid skill into an isolated temporary directory and ran:

npm install --ignore-scripts --no-audit --no-fund --registry=https://registry.npmjs.org

That installed 34 packages, after which the same minimal Liquid validation passed. I did not modify the managed plugin cache.

This confirms that the current Codex failure is caused by the published skill not being self-contained. Codex installs the plugin files but does not automatically install each skill’s npm dependencies.

Could the Liquid validator dependencies be bundled or vendored with the published plugin so scripts/validate.mjs works immediately after installing the managed plugin? A managed, auto-updating plugin should not require users or agents to modify its versioned cache manually.

davetanguay-envision avatar Jul 22 '26 20:07 davetanguay-envision

Fix until running

thewholedonuts-beep avatar Aug 30 '26 13:08 thewholedonuts-beep

Additional reproduction and isolated repair results from the managed Shopify plugin for Codex:

Environment: Linux, Node.js 24.18.0, curated Shopify plugin 4.1.1.

The Liquid validator fails even with --help, reporting ERR_MODULE_NOT_FOUND for @shopify/theme-check-common. Its package manifest already declares:

  • @shopify/theme-check-common: 3.24.0
  • @shopify/theme-check-docs-updater: 3.24.0
  • @shopify/theme-check-node: 3.24.0

None resolved from the installed helper. Six other validator skills also had an unresolved declared TypeScript dependency, version 5.9.3. Hydrogen independently reproduced a startup failure.

Isolated trial: We copied the seven affected skill directories into a temporary environment and installed their declared dependencies through npm workspaces, using the public npm registry with installation scripts disabled. No validator source changes or dependency-version overrides were needed.

All 13 checks passed:

  • Seven validators started and displayed help.
  • Liquid accepted a valid section fixture in standalone and full-theme modes.
  • Both modes rejected an unclosed Liquid conditional.
  • Both modes rejected a section schema with an invalid property type.

The 58 inspected files in the original managed installation remained unchanged.

Limits: Tests used the packages’ bundled documentation and schemas because online refresh was blocked. The six non-Liquid validators received startup checks only. We did not establish real-theme CLI parity or a supported permanent deployment procedure. We also did not reproduce the private-registry lockfile condition described in this issue.

This demonstrates that making the declared dependencies available is sufficient for the tested Liquid behavior. Could the maintainers confirm how these dependencies should be provisioned by the managed Codex installation, and provide a supported repair or corrected distribution?

bubbaaz avatar Oct 05 '26 00:10 bubbaaz