You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Got an error, that it can not run a common js script in a type: module package:
file:///tmp/storybook/index.js:2
const { execSync } = require('child_process');
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/tmp/storybook/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///tmp/storybook/index.js:2:22
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:106:12)
Node.js v18.19.1
Expected behavior:
Should work also in an ESM environment. Changing the name to index.cjs would fix this. Allthough it is kind of weird that this script is added to the package.
Additional Information:
The text was updated successfully, but these errors were encountered:
Hi there @kasperpeulen ! Thank you for the enhancement request, and thank you for your patience too. Do you have a suggested implementation for this? Would you like to submit a PR?
Orb version:
1.6.2
What happened:
Got an error, that it can not run a common js script in a type: module package:
Expected behavior:
Should work also in an ESM environment. Changing the name to
index.cjs
would fix this. Allthough it is kind of weird that this script is added to the package.Additional Information:
The text was updated successfully, but these errors were encountered: