For me, it looks like an npm package is causing the error message. I replaced the ‘require’ code in the workflow, but still get “Must use import …” for fetch.
const { default: fetch } = await import('node-fetch');
const { default: FMData } = await import('fm-data-api-client');
When I comment out the ‘fm-data-api-client’ line, I get the following error.
ErrorCannot find module 'node-fetch' Require stack: - /tmp/ee/node_modules/fm-data-api-client/lib/Client.js - /tmp/ee/node_modules/fm-data-api-client/lib/index.js
Here’s their reference to fetch in Client.js. No references in index.js.
import fetch, {Headers, RequestInit} from 'node-fetch';
Is there another way I can resolve this? Thanks!