-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unexpected token 'export' #15
Comments
I had conversation about this with chatgpt: https://chat.openai.com/share/452fcec7-ae51-49ab-9e0e-b22bd9c0e059 |
If I run this file ( async ({ deep, data: { newLink: notifyLink, triggeredByLinkId }, }) => {
};
export {};
//# sourceMappingURL=module.js.map by using
It will run without problem |
If I run this file ( eval(`
async ({ deep, data: { newLink: notifyLink, triggeredByLinkId }, }) => {
};
export {};
//# sourceMappingURL=module.js.map
`) by using
It will throw the error:
|
I have talked about this with GPT-4: https://chat.openai.com/share/5bbda39d-1ad5-4eb7-93f1-59061fe47a59 |
@FreePhoenix888 did you try to put export before the function? Our code expects that the last expression of the code string will be function expression. |
The reason is - tsx now transpiles ts to esnext (or smth like that) but code is executed by eval by js provider Eval does not know what export is As workaround I remove this export |
@FreePhoenix888 I think we can close this issue in favor of #19 What do you think? |
I do not export smth manually, export is added itself when tsx bundles to jsx |
Error
Unexpected token 'export'
Source Code
Dist code transpiled by
@deep-foundation/tsx
packageQuestion
Is this the problem of
js-docker-isolation-provider
or@deep-foundation/tsx
package? What should we do? The scariest thing is that I have been using handler code transpiled by that version of tsx package and everything was working. I do not know what is changed the way to brake itThe text was updated successfully, but these errors were encountered: