There is an ERR_REQUIRE_ESM error while executing ui-component command.
I know this is not directly an issue with the cli but I cannot find any repo for ui-component.
c:\DOWNLOADS>node -v
v14.21.3
c:\DOWNLOADS>npm -v
6.14.18
c:\DOWNLOADS>snc version
{
"extensions": {
"ui-component": "27.4.5"
},
"snc": "1.1.0"
}
c:\DOWNLOADS>snc ui-component develop --loginHost https://REMOVED.service-now.com --username REMOVED --password REMOVED
develop
Run component in local development environment.
Options:
--version Show version number [boolean]
--help Show help [boolean]
--entry, -e The example's entry point
[string] [default: "example\element.js"]
--open Run component in a new browser tab
automatically [boolean] [default: false]
--port Run component on port specified. [number]
--host, -h Run component on host address specified.
[string] [default: "127.0.0.1"]
--fetch-assets-from-instance, --fa Fetch the assets of optional dependency
packages from the configured instance.
[boolean] [default: false]
--cache-build-output, --cb Cache the build output for faster re-runs
[boolean] [default: false]
--clear-cache, --cc delete the persistent cache
[boolean] [default: false]
--type-check, --tc Enables type checking for TypeScript and
JavaScript [boolean] [default: true]
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\brace-expansion\index.js
require() of ES modules is not supported.
require() of C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\brace-expansion\index.js from C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\minimatch\dist\commonjs\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 C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\brace-expansion\index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\brace-expansion\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 Module.Hook._require.Module.require (C:\Users\micro\.snc\.extensions\ui-component\node_modules\require-in-the-middle\index.js:80:39)
at Module.Hook._require.Module.require (C:\Users\micro\.snc\.extensions\ui-component\node_modules\require-in-the-middle\index.js:80:39)
at Module.Hook._require.Module.require (C:\Users\micro\.snc\.extensions\ui-component\node_modules\require-in-the-middle\index.js:80:39)
at Module.Hook._require.Module.require (C:\Users\micro\.snc\.extensions\ui-component\node_modules\require-in-the-middle\index.js:80:39)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (C:\Users\micro\.snc\.extensions\ui-component\node_modules\glob\node_modules\minimatch\dist\commonjs\index.js:7:43)
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) {
code: 'ERR_REQUIRE_ESM'
}
There is an ERR_REQUIRE_ESM error while executing ui-component command.
I know this is not directly an issue with the cli but I cannot find any repo for ui-component.