create-wc-extension
-
Running into an issue when trying to create an extension for WooCommerce.
I have installed the proper version on pnpm (which wasn’t the most up to date version), and ran pnpm after installing both it and composer dependencies, but am getting this error.
pnpm run create-wc-extension > @woocommerce/[email protected] create-wc-extension /Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin > node ./bin/starter-pack/starter-pack.js internal/modules/cjs/loader.js:1080 throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath); ^ Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin/node_modules/.pnpm/[email protected]/node_modules/chalk/source/index.js require() of ES modules is not supported. require() of /Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin/node_modules/.pnpm/[email protected]/node_modules/chalk/source/index.js from /Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin/bin/starter-pack/starter-pack.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 index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin/node_modules/.pnpm/[email protected]/node_modules/chalk/package.json. at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (/Users/joeholston/code/ziptie/wp-content/plugins/woocommerce-admin/bin/starter-pack/starter-pack.js:4:15) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) { code: 'ERR_REQUIRE_ESM' } ELIFECYCLE Command failed with exit code 1.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘create-wc-extension’ is closed to new replies.