Closed jd-ucpa closed 1 week ago
Hi,
I'm using mail-mime-builder 0.1.0in es mode :
mail-mime-builder 0.1.0
import { createMimeMessage } from 'mail-mime-builder'
It throw an error :
{ "errorType": "Error", "errorMessage": "Cannot find module '/var/task/node_modules/mail-mime-builder/es/base64' imported from /var/task/node_modules/mail-mime-builder/es/MIMEMessage.js", "code": "ERR_MODULE_NOT_FOUND", "url": "file:///var/task/node_modules/mail-mime-builder/es/base64", "...": "..." }
I resolve this issue by editing all the packages files in the node_modules directory and adding .js extension to some files :
.js
The current exported file node_modules/mail-mime-builder/es/MIMEMessage.js throw this error :
node_modules/mail-mime-builder/es/MIMEMessage.js
// file : node_modules/mail-mime-builder/es/MIMEMessage.js import { toBase64EncodeURI } from './base64'; import { MIMETextError } from './MIMETextError'; import { MIMEMessageHeader } from './MIMEMessageHeader'; import { Mailbox } from './Mailbox'; import { MIMEMessageContent } from './MIMEMessageContent'; export class MIMEMessage { // ...
My updated version works :
import { toBase64EncodeURI } from './base64.js'; import { MIMETextError } from './MIMETextError.js'; import { MIMEMessageHeader } from './MIMEMessageHeader.js'; import { Mailbox } from './Mailbox.js'; import { MIMEMessageContent } from './MIMEMessageContent.js'; export class MIMEMessage { // ...
Sometimes you use extesion and sometimes you don't :
https://github.com/shyim/mail-mime-builder/blob/main/src/MIMEMessageHeader.ts#L1-L5
import type {HeaderField} from './types' import {toBase64} from './base64' import {MIMETextError} from './MIMETextError.js' import {Mailbox} from './Mailbox.js'
Thank you
weird the typescript compiler should unify it https://github.com/shyim/mail-mime-builder/blob/main/package.json#L19-L21
it will take a look later
Is fixed now sorryy that it too so long
Great ! Thank you !
Hi,
I'm using
mail-mime-builder 0.1.0
in es mode :It throw an error :
I resolve this issue by editing all the packages files in the node_modules directory and adding
.js
extension to some files :The current exported file
node_modules/mail-mime-builder/es/MIMEMessage.js
throw this error :My updated version works :
Sometimes you use extesion and sometimes you don't :
https://github.com/shyim/mail-mime-builder/blob/main/src/MIMEMessageHeader.ts#L1-L5
Thank you