Skip to content

imports not working in typescript project #124

Open
@oakgary

Description

@oakgary

/file_a.ts

export async function test() {
  console.log('test');
}

/file_b.ts

import { test } from './file_a.ts';
export async function handler(event: LambdaEvent): Promise<LambdaResponse> {
  await test();
}

Executing the handler of file_b (using sls offline or deploying to aws) leads to something like:

TypeError: file_a_1.test is not a function

Both eslint and typescript are not showing any errors. The code is compiling fine.
I assume it has something to do with webpack or babel.

That is the issue I am facing right now in a nutshell.
I will try to create a small repo to reproduce this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions