Skip to content

fix(create-module): ensure compatibility with yarn create - #527

Merged
GauBen merged 1 commit into
mainfrom
fix/unplug-create-module
Oct 8, 2025
Merged

GauBen merged 1 commit into
mainfrom
fix/unplug-create-module

Conversation

@GauBen

@GauBen GauBen commented Oct 8, 2025

Copy link
Copy Markdown
Member

Description

yarn create @jahia/module should work the same as npm init @jahia/module@latest but fails because of filesystem errors. This flag enforces a physical filesystem (node_modules) instead of a virtual one (zipfs).

Checklist

Source code

  • I've shared and documented any breaking change
  • I've reviewed and updated the jahia-depends

Tests

  • I've provided Unit and/or Integration Tests
  • I've updated the parent issue with required manual validations

Tip

Documentation to guide the reviews: How to do a code review

Copilot AI review requested due to automatic review settings October 8, 2025 12:17
@GauBen
GauBen requested a review from a team as a code owner October 8, 2025 12:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes compatibility issue with yarn create @jahia/module by enforcing physical filesystem usage instead of virtual filesystem (zipfs) through the preferUnplugged configuration.

  • Added preferUnplugged: true flag to package.json to ensure yarn uses node_modules instead of zipfs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GauBen

GauBen commented Oct 8, 2025 •

Copy link
Copy Markdown
Member Author

QA

Before:

❯ yarn create @jahia/module
➤ YN0000: · Yarn 4.9.2-git.20250603.hash-c301b51
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @jahia/create-module@npm:1.0.0, @clack/core@npm:0.5.0, @clack/prompts@npm:0.11.0, picocolors@npm:1.1.1, sisteransi@npm:1.0.5
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 5 packages were added to the project (+ 608.6 KiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 289ms

┌  Jahia JavaScript Module Creator
│
◇  What is the name of your module?
│  sqd
│
◇  Where do you want to create the module?
│  /Users/gbenaim/Developer/prototypes/sqdq
│
◇  Which module type do you want?
│  A minimal Hello World template set
└  Something went wrong

If you believe this is a bug, please report it at:
  https://github.com/Jahia/javascript-modules/issues


TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at Object.join (node:path:1304:7)
    at file:///private/var/folders/nq/5sbqxy457yj6_x1_28c_x2sr0000gp/T/xfs-71a8ad85/dlx-44877/.yarn/cache/@jahia-create-module-npm-1.0.0-7b715ddc7c-f397fa52b1.zip/node_modules/@jahia/create-module/index.js:99:25
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

After:

❯ yarn create @jahia/module@alpha
➤ YN0000: · Yarn 4.10.3-git.20250922.hash-8bbf37d
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @jahia/create-module@npm:1.1.0-alpha-20251008135115673, @clack/core@npm:0.5.0, @clack/prompts@npm:0.11.0, picocolors@npm:1.1.1, sisteransi@npm:1.0.5
➤ YN0000: └ Completed in 1s 630ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 5 packages were added to the project (+ 608.71 KiB).
➤ YN0000: └ Completed in 1s 708ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 3s 423ms

┌  Jahia JavaScript Module Creator
│
◇  What is the name of your module?
│  qds
│
◇  Where do you want to create the module?
│  /Users/gbenaim/Developer/prototypes/qds
│
◇  Which module type do you want?
│  A minimal Hello World template set
│
└  Successfully created a new Jahia module project!

Run the following commands to get started:
  1. cd /Users/gbenaim/Developer/prototypes/qds
  2. yarn install              # Install dependencies
  3. docker compose up --wait  # Start Jahia in Docker
  4. yarn dev                  # Start the dev mode

The README.md file contains a reminder of all commands.

@GauBen
GauBen enabled auto-merge (squash) October 8, 2025 12:22
@GauBen
GauBen merged commit 3bc976f into main Oct 8, 2025
11 checks passed
@GauBen
GauBen deleted the fix/unplug-create-module branch October 8, 2025 12:40
@x0h01

x0h01 commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Important prerequisite:

yarn create @jahia/module works fine when executed from the module's repo.
Issue is reproducible only when running from outside the repo.

✅️ Got the same results with #527 (comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants