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
I think the build configuration is missing something in the export.
When I build and then launch the app, it's working find.
But when I launch my unit test with Jest, like that
I don't see so many exports in other libraries' package.json,
so it might be working only with main & types (without exports).
Am I missing something ?
An other question, why do we need to use import PostalMime from './node_modules/postal-mime/src/postal-mime.js'; for browser instead of import PostalMime from 'postal-mime'; (written in readme) ? I'm using the second one, and it's working.
Thanks a lot for your lib !
Léo
The text was updated successfully, but these errors were encountered:
PostalMime is an ESM module and, as such, does not need to be bundled or built at all. In order for the browser to know where the PostalMime's ESM module file actually is, you would need to use the full file path for the import. As you probably use some kind of bundling, then the bundler sets the location instead.
Hi,
as stated here :
I think the build configuration is missing something in the export.
When I build and then launch the app, it's working find.
But when I launch my unit test with Jest, like that
it is throwing the below error :
if I put the default node in your lib package.json exports like so
or completly remove the exports node
its working.
I don't see so many exports in other libraries' package.json,
so it might be working only with main & types (without exports).
Am I missing something ?
An other question, why do we need to use
import PostalMime from './node_modules/postal-mime/src/postal-mime.js';
for browser instead ofimport PostalMime from 'postal-mime';
(written in readme) ? I'm using the second one, and it's working.Thanks a lot for your lib !
Léo
The text was updated successfully, but these errors were encountered: