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
Since the mjs is prior to js in webpack's default resolve.extensions, the module is used in priority.
It caused problems in banks since the result of the require was a "module" object with a default property. Other libs (like isomorphic-fetch) rely on the result of require('node-fetch') to be the fetch function.
node-fetch
can be used to provide the fetch function to services.Recently, it introduced a "module" entrypoint that is used by webpack when webpack's target is node.
Since the
mjs
is prior tojs
in webpack's defaultresolve.extensions
, the module is used in priority.It caused problems in banks since the result of the require was a "module" object with a
default
property. Other libs (like isomorphic-fetch) rely on the result ofrequire('node-fetch')
to be thefetch
function.This is why in banks, the resolve was forced to use
lib/index.js
. See https://github.com/cozy/cozy-banks/blob/e6bc4fdc762031300de393811a03dd926c878a89/config/webpack.target.services.js#L90.The text was updated successfully, but these errors were encountered: