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

Build error with new derivative function using imports #1230

Open
BeeBombshell opened this issue Apr 28, 2023 · 0 comments
Open

Build error with new derivative function using imports #1230

BeeBombshell opened this issue Apr 28, 2023 · 0 comments

Comments

@BeeBombshell
Copy link
Member

OP: AlexR#9157 on Discord Support Forum

Describe the bug
I attempted to create a new derivative function using the new version that supports imports. However, I encountered an unknown build error even when using a basic boilerplate derivative function with the following code:

// Import any NPM package needed
// import _ from "lodash";
const derivative: Derivative = async ({ row, ref, db, storage, auth, logging }) => {

  return "Hello";
};
export default derivative;

After deploying the function, I received the following build error:

functionConfig.ts(282,8): error TS1005: ',' expected.
functionConfig.ts(284,12): error TS1005: ':' expected.
functionConfig.ts(284,20): error TS1005: ':' expected.

The error stack trace is as follows:

Error: Command failed: cd build/functionBuilder/builds/1682449598986/src;tsc functionConfig.ts

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Additional context
I believe that the build error only occurs when the export statement is included in the code. When I remove the export statement, the function builds without errors.

For another user (Raaj#5095)
Having the same issue. It doesn't even work if I remove the export statement also.

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