I have developed an npm package that utilizes a dynamic import()
. This package is written in TypeScript and compiled with the module: "esnext"
compiler option, which means the import()
call remains unchanged in the output.
The expectation was to load this module into an application where the import call (
import('cross-fetch').then(/* ... */)
) would be resolved automatically.
However, despite using Create React App to bootstrap the application (which includes various polyfills), I am encountering the following error:
Error: Cannot find module 'cross-fetch'
Is it currently feasible for a client-side application to resolve dynamic imports from one of its dependencies to another Node module? If so, what bundles should be used and how should the configuration be done?