This topic was automatically generated from Slack. You can find the original thread here.
Rinat Uspensky : But I see ErrorMust use import to load ES Module: /opt/ee/node_modules/array-differ/index.js require() of ES modules is not supported. require() of /opt/ee/node_modules/array-differ/index.js from /opt/ee/c_lKfEMma/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 /opt/ee/node_modules/array-differ/index.js to end in .cjs, change the requiring code to use import(), or remove “type”: “module” from /opt/ee/node_modules/array-differ/package.json.
Michelle Bergeron : It looks like the error is saying to use import instead of require. I would try changing this line: **const** arrayDiffer = require('array-differ');
to this: const arrayDiffer = import('array-differ');
Giao Phan : When you are using esm and you export a default object (instead of using named exports), the async import returns that as an object with a default key.
Raymond Camden : i mostly get that do yall document how to use ESM stuff? it (not w/ PD, but in Node in general) has been biting me in the rear a lot all of a sudden
Giao Phan : Yeah, we are trying to figure out our strategy. There has definitely been a noticeable shift to ESM only packages in the new year, but we can’t make the shift without AWS supporting it as well.
Raymond Camden : any plans for Pipedream docs to talk about it?even if there isn’t a great one size fits all solution, I can see this coming up more and more
Danny Roosevelt : yea, @UMT4G7E5P and I chatted about this and think that’s a good idea and would be helpful. I created an issue here to track it for us in case you’re interested in following along.