Skip to content

CLI crashes immediately with ParserError from @scratch-fuse/builtins when following official docs #1

@scrapal

Description

@scrapal

Description

When attempting to compile a project strictly following the usage instructions in the README, the CLI crashes immediately. The crash occurs during the initialization phase before the compiler even attempts to read the project.yaml file.

The stack trace indicates that the currently published @scratch-fuse/core parser is failing to parse the internal standard library defined in the @scratch-fuse/builtins package.

Steps to Reproduce

  1. Create a basic FUSE project configuration file (project.yaml) and a target .fuse script.
  2. Run the compilation command exactly as documented using npx:
    npx @scratch-fuse/fuse project.yaml result.sb3
  3. The CLI immediately throws a ParserError.

Error Log

/Users/a8cde/.nvm/versions/node/v24.13.1/lib/node_modules/@scratch-fuse/fuse/node_modules/@scratch-fuse/core/dist/index.js:1462
      throw new import_utility.ErrorList(errors);
      ^

ErrorList: Multiple errors:
  ParserError: Unexpected token Punctuation: { at 1:20-2
    at Parser.parsePrimary (/Users/a8cde/.nvm/versions/node/v24.13.1/lib/node_modules/@scratch-fuse/fuse/node_modules/@scratch-fuse/core/dist/index.js:863:11)
    ...
    at Parser.parse (/Users/a8cde/.nvm/versions/node/v24.13.1/lib/node_modules/@scratch-fuse/fuse/node_modules/@scratch-fuse/core/dist/index.js:1462:13)
    at /Users/a8cde/.nvm/versions/node/v24.13.1/lib/node_modules/@scratch-fuse/fuse/node_modules/@scratch-fuse/builtins/dist/index.js:1241:26

Root Cause Analysis

I investigated the compiled files in the published npm packages. The ParserError at 1:20 is triggered by the builtin_default string inside @scratch-fuse/builtins/dist/index.js.

The parser fails precisely at this line:

namespace motion = {

The current version of the @scratch-fuse/core parser appears to reject the = character before the { in namespace declarations (and similarly in block definitions like moveSteps = {).

It seems the syntax rules in the core parser have been updated recently, but the raw FUSE definitions string inside the published builtins package (specifically src/builtin.fuse) was not updated to reflect these new syntax rules. As a result, the published packages on npm are currently incompatible with each other.

Environment

  • OS: macOS
  • Node.js: v24.13.1
  • Execution Method: npx @scratch-fuse/fuse (Global execution)

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