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

Plain eval is used without transpilation. Ts handlers do not work #4

Open
Konard opened this issue Sep 3, 2024 · 0 comments
Open

Comments

@Konard
Copy link
Member

Konard commented Sep 3, 2024

Describe the bug

Plain eval is used without transpilation:

https://github.com/deep-foundation/js-docker-isolation-provider/blob/7d4ffde2b77ede4c50540c2710fe5fdabfc89ab2/index.ts#L31

Example Of Non-Working Typescript Handler

Handler Code

import { DeepClient } from "@deep-foundation/deeplinks/imports/client.js";
import { Link } from "@deep-foundation/deeplinks/imports/minilinks.js";
import { DeepClientInstance } from "@deep-foundation/deeplinks/imports/client";

async (options: {
  deep: DeepClient;
  data: {
    newLink: Link<number>;
  };
}) => {
    return 5
};

Error

{
  "stack": "SyntaxError: Cannot use import statement outside a module\n    at eval (<anonymous>)\n    at memoized (/node_modules/lodash/memoize.js:62:23)\n    at makeFunction (file:///index.js:29:16)\n    at file:///index.js:61:20\n    at Generator.next (<anonymous>)\n    at file:///index.js:7:71\n    at new Promise (<anonymous>)\n    at __awaiter (file:///index.js:3:12)\n    at file:///index.js:56:33\n    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)",
  "message": "Cannot use import statement outside a module"
}

Expected Behavior

No response

Current Behavior

No response

Steps to reproduce

No response

Environment

No response


Forked from deep-foundation/js-docker-isolation-provider#19 by https://github.com/konard/gh-org-migrator

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

No branches or pull requests

1 participant