Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESM module loader fails on TypeScript projects #143

Closed
lance opened this issue Dec 15, 2022 · 0 comments · Fixed by #144
Closed

ESM module loader fails on TypeScript projects #143

lance opened this issue Dec 15, 2022 · 0 comments · Fixed by #144

Comments

@lance
Copy link
Member

lance commented Dec 15, 2022

The module loader is looking for a package.json file in the directory where the function was found. In the case of TypeScript functions, the function itself will be in ./build and the package.json file is in ../. I think the loader should probably traverse up directories until it finds a package.json file before it fails.

See: knative/func#1468 (comment)

/cc @lholmquist

lance added a commit to lance/faas-js-runtime that referenced this issue Dec 15, 2022
This resolves issues where function source may be in a subdirectory, for
example `./build` in a TypeScript project.

Fixes: nodeshift#143

Signed-off-by: Lance Ball <lball@redhat.com>
lance added a commit to lance/faas-js-runtime that referenced this issue Dec 16, 2022
This resolves issues where function source may be in a subdirectory, for
example `./build` in a TypeScript project.

Fixes: nodeshift#143

Signed-off-by: Lance Ball <lball@redhat.com>
lance added a commit to lance/faas-js-runtime that referenced this issue Dec 16, 2022
This resolves issues where function source may be in a subdirectory, for
example `./build` in a TypeScript project.

Fixes: nodeshift#143

Signed-off-by: Lance Ball <lball@redhat.com>
lance added a commit to lance/faas-js-runtime that referenced this issue Dec 16, 2022
This resolves issues where function source may be in a subdirectory, for
example `./build` in a TypeScript project.

Fixes: nodeshift#143

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance closed this as completed in #144 Jan 5, 2023
lance added a commit that referenced this issue Jan 5, 2023
This resolves issues where function source may be in a subdirectory, for
example `./build` in a TypeScript project.

Fixes: #143

Signed-off-by: Lance Ball <lball@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant