-
Notifications
You must be signed in to change notification settings - Fork 188
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
[Bug]: Build fails for ESM modules #751
Comments
Not sure if this is directly related. But I tried to add [email protected] as a dependency, and was finding that zapier push is not including all the files properly. Using import/export in typescript is fine as currently they get transpiled into require calls. But if the packages in node_modules themselves are using import/export, then things seems to be broken. |
Any update's on this? I would like to use ESM syntax when developing my zap. |
You can use ESM syntax for your own files and code. |
To clarify I was looking for native ESM support in the zapier-platform without a build step (example build steps: typescript/babel). I tried converting my app to ESM and running the latest node (v22.4.1) I get the following error when running
// index.js
import{ app } from './src/app.js';
export default app; However, after spending from time looking into ESM and CommonJS interop, I believe the ROI for my request is low since it looks like the zapier platform is written in CommonJS and that would be a lot of code to rewrite into ESM. I will just stick with keeping my zap in CommonJS, and if I really need ESM features (life from a dependency), use a transpiler (babel/typescript). |
Bug Description
We are trying to build a zapier project using
"type": "module"
in thepackage.json
file. We need this to be able to reference ESM dependencies. The code builds, but when we runzapier push
we get the error below:Reproduction Steps
"type": "module"
in the package.jsonZapier Platform version
15.5.3
Node.js version
18.5.0
Your Operating System
darwin-arm64
npm/yarn version
9.6.7
App ID
No response
More Details
No response
The text was updated successfully, but these errors were encountered: