Skip to content

ox_core template and scaffold call require without loading ox_lib #29

Closed

Description

@TMHSDigital

Summary

The ox_core template and the ox_core scaffold output start both scripts with local Ox = require '@ox_core.lib.init', but neither manifest loads ox_lib, which is what provides the '@resource.module' form of require. The resource is expected to error on its first line at start.

Where

  • templates/oxcore/client/main.lua:1, templates/oxcore/server/main.lua:1
  • templates/oxcore/fxmanifest.lua:8-12 (only dependency 'ox_core', no ox_lib)
  • mcp-server/tools/scaffold.py:19, mcp-server/tools/scaffold.py:29 (FRAMEWORK_INIT_CLIENT / FRAMEWORK_INIT_SERVER, oxcore)
  • mcp-server/tools/scaffold.py:101-103 (_build_manifest, uses FRAMEWORK_DEPS only)
  • mcp-server/tools/manifest_common.py:16 (FRAMEWORK_DEPS["oxcore"] = "ox_core")

Details

The ox_core docs say to load it with shared_script '@ox_core/lib/init.lua', or alternatively to use the require function from ox_lib. The '@resource.path' module syntax comes from ox_lib's init.lua. The repo's own skills/framework-detection/SKILL.md:119-121 notes that ox_core resources use require '@ox_lib.init'. Neither templates/oxcore/fxmanifest.lua nor the scaffolded manifest declares shared_script '@ox_lib/init.lua' or dependency 'ox_lib'.

Impact

Every resource from templates/oxcore or scaffold_resource_tool(framework="oxcore") fails on line 1 with a module-not-found (or require nil) error, so Ox is never defined. This is the starting point the plugin offers ox_core users.

Steps to reproduce

  1. Copy templates/oxcore into a server that runs ox_core (and ox_lib, but not referenced by the resource).
  2. ensure the resource.
  3. The client and server consoles show the error resolving @ox_core.lib.init.

Suggested fix

Choose one approach and apply it to both the template and the scaffolder:

  • Add shared_script '@ox_lib/init.lua' and dependencies { 'ox_lib', 'ox_core' }, keeping require; or
  • Drop require, add shared_script '@ox_core/lib/init.lua', and use the global Ox.

For the scaffolder, the ox_lib dependency and shared script need to be emitted by the manifest builder for oxcore (not just FRAMEWORK_DEPS).

Acceptance criteria

  • templates/oxcore loads on a server with ox_core and ox_lib without errors.
  • scaffold_resource_tool(framework="oxcore") emits a manifest that loads whatever the init line requires.
  • The framework-detection skill and the template agree on the init pattern.

Getting started

  • Relevant files: templates/oxcore/fxmanifest.lua, templates/oxcore/client/main.lua, templates/oxcore/server/main.lua, mcp-server/tools/scaffold.py
  • How to run checks: there is no test suite yet; run the MCP server with cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in .github/workflows/validate.yml
  • Related docs: skills/framework-detection/SKILL.md, ox_core documentation (overextended)

Filed by repo-audit/full-audit at 701824d. Severity: high. Effort: S. audit-key: bug|templates/oxcore/fxmanifest.lua|ox_lib

Activity

  1. added
    bug
    good first issue
    on Nov 21, 2026
  2. TMHSDigital commented on Nov 21, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in ce8b804.

    The ox_core template and generated manifests now depend on ox_lib and load '@ox_lib/init.lua' before the scripts that call require; the framework-detection skill documents it.

    Verified: Checked the template manifest and the output of scaffold_resource and generate_manifest for framework oxcore (ox_lib dependency and shared script present) and that other frameworks are unchanged. Not run on a live FXServer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueseverity: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions