Problem with dependencies

Created on 24 June 2024, 5 months ago
Updated 25 June 2024, 5 months ago

Problem/Motivation

After cloning this theme, multiple dependency problems keep the clone theme from compiling.

Steps to reproduce

I have created a cloned theme as explained in the documentation.

I use Lando as my development environment.

I had to downgrade to Node Ver 14 to be able to run `yarn install`.

When I try to run gulp watch I get the following error:

$ lando gulp watch --verbose
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /app/html/themes/custom/mytheme/node_modules/run-sequence/node_modules/chalk/source/index.js
require() of ES modules is not supported.
require() of /app/html/themes/custom/mytheme/node_modules/run-sequence/node_modules/chalk/source/index.js from /app/html/themes/custom/mytheme/node_modules/run-sequence/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /app/html/themes/custom/mytheme/node_modules/run-sequence/node_modules/chalk/source/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /app/html/themes/custom/mytheme/node_modules/run-sequence/node_modules/chalk/package.json.

    at new NodeError (internal/errors.js:322:7)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1131:13)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/app/html/themes/custom/mytheme/node_modules/run-sequence/index.js:5:14)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/app/html/themes/custom/mytheme/gulpfile.js:22:19)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10) {
  code: 'ERR_REQUIRE_ESM'
}

Proposed resolution

Please resolve the dependency or explain how to compile this theme inside an environment like Lando.

πŸ› Bug report
Status

Active

Version

2.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jcmartinez
  • πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA
  • πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

    While figuring out why I couldn't run `yarn install,` I deleted the file yarn.lock.

    Later, after downgrading to Node ver. 14, I could run `yarn install`, but I couldn't get `gulp watch` to complete.

    By restoring the original yarn.lock file, I was able to get `gulp watch` working.

    Please add the following text to the description of this theme:

    Before you can run `yarn install`, ensure your Node version is not newer than 14. The yarn.lock file provided is required to install the proper version of the different Node modules.

Production build 0.71.5 2024