Skip to content

Crash when ejs file used #340

@doteric

Description

@doteric

Bug report

When an .ejs file is imported the generator seems to fail as a whole. Error:

src/example.ts(4,26): error TS2307: Cannot find module './example.ejs' or its corresponding type declarations.

Input code

import { renderFile } from 'ejs';

import type { BodyType } from './eventParser.js';
import htmlBodyPath from './emailContent.ejs';

const example = async (
  body: BodyType & { submitter: string }
): Promise<string> =>
  new Promise((resolve, reject) => {
    return renderFile(htmlBodyPath, body, (err, renderedHtml) => {
      if (err) {
        reject(err);
      }
      resolve(renderedHtml);
    });
  });

export default example;

Created separate issue as requested here: #338 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions