Skip to content

Typescript local import #79

Closed
Closed
@MatthewAlner

Description

@MatthewAlner

I made a quick test project to try out the new Typescript support structure looks like this.

.
├── functions
│   ├── jokeTypescript.js
│   └── jokeVanilla.js
├── netlify.toml
├── package.json
├── src_functions
│   ├── jokeTypescript.ts
│   ├── jokeVanilla.js
│   └── utils
│       └── direction.ts
└── yarn.lock

when I try to import something local like this

import { Direction } from './utils/direction';

in jokeTypescript.ts, I get an error in the build like this

ERROR in ./jokeTypescript.ts
Module not found: Error: Can't resolve './utils/direction' in '/Users/matt/sandbox/nl-test/src_functions'
 @ ./jokeTypescript.ts 6:0-46 19:21-30

external imports like import * as request from 'request-promise-native'; seem to work though

any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions