Best answer

Error when running zapier build

  • 5 April 2023
  • 1 reply
  • 161 views

Badge +1

 When I attempt to build my integration, I get an error:

zapier build -d
zapier:build argv is [ '-d' ] +0ms
zapier:build args are {} +2ms
zapier:build flags are { debug: true } +0ms
zapier:build ------------ +0ms
zapier:analytics sending {
command: 'build',
isValidCommand: true,
numArgs: 0,
flags: { debug: true },
cliVersion: '12.2.0',
os: 'darwin',
sendUserId: true
} +0ms
✔ Copying project to temp directory
⠋ Installing project dependencies zapier:misc
zapier:misc +0ms
zapier:misc Running npm install --production command in /private/var/folders/ns/tcvthqms11z7n5168r37z_7w0000gn/T/zapier-c0fedeb6:
zapier:misc +0ms
⠙ Installing project dependencies zapier:api >> POST https://zapier.com/api/platform/cli/analytics +0ms
zapier:api >> {"command":"build","isValidCommand":true,"numArgs":0,"flags":{"debug":true},"cliVersion":"12.2.0","os":"darwin"} +0ms
zapier:api << 200 +0ms
zapier:api << {"success": true} +0ms
zapier:api ------------ +0ms
zapier:analytics success: true +247ms
⠸ Installing project dependencies zapier:misc npm +318ms
zapier:misc WARN +0ms
zapier:misc config production Use `--omit=dev` instead.
zapier:misc +0ms
⠼ Installing project dependencies zapier:misc
zapier:misc added 27 packages, and audited 28 packages in 2s
zapier:misc +2s
zapier:misc
zapier:misc found 0 vulnerabilities
zapier:misc +1ms
✔ Installing project dependencies
✔ Applying entry point file
✔ Building app definition.json
⠙ Validating project style zapier:api >> GET
✔ Validating project style
⠋ Zipping project and dependenciesnode:events:515
throw er; // Unhandled 'error' event
^

Error: Parsing file /private/var/folders/ns/tcvthqms11z7n5168r37z_7w0000gn/T/zapier-c0fedeb6/lib/adp_client.js: visitor[(override || node.type)] is not a function
at Deps.parseDeps (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/module-deps/index.js:519:15)
at getDeps (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/module-deps/index.js:447:44)
at /usr/local/lib/node_modules/zapier-platform-cli/node_modules/module-deps/index.js:430:38
at ConcatStream.<anonymous> (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/concat-stream/index.js:37:43)
at ConcatStream.emit (node:events:549:35)
at ConcatStream.emit (node:domain:482:12)
at finishMaybe (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:630:14)
at endWritable (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at Writable.end (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at DuplexWrapper.onend (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:651:28)
at DuplexWrapper.emit (node:events:549:35)
at DuplexWrapper.emit (node:domain:482:12)
at endReadableNT (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on Readable instance at:
at Labeled.<anonymous> (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/read-only-stream/index.js:28:44)
at Labeled.emit (node:events:537:28)
at Labeled.emit (node:domain:482:12)
at Labeled.<anonymous> (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/stream-splicer/index.js:130:18)
at Labeled.emit (node:events:537:28)
at Labeled.emit (node:domain:482:12)
at Deps.<anonymous> (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/stream-splicer/index.js:130:18)
at Deps.emit (node:events:537:28)
at Deps.emit (node:domain:482:12)
at /usr/local/lib/node_modules/zapier-platform-cli/node_modules/module-deps/index.js:414:22
at /usr/local/lib/node_modules/zapier-platform-cli/node_modules/module-deps/index.js:431:35
at ConcatStream.<anonymous> (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/concat-stream/index.js:37:43)
[... lines matching original stack trace ...]
at endReadableNT (/usr/local/lib/node_modules/zapier-platform-cli/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js:1010:12)

zapier validate and zapier test work as expected, however.

What might be the problem?

I’m using node 18.5.0.

 

icon

Best answer by benjamink9 5 April 2023, 23:34

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Badge +1

Found the solution.

I was declaring libraries “in line”:

class AdpClient {

...

const body = require('querystring').stringify({

...

const req = require('https').request(options, (res) => {

...

}

When I moved the declaration to the top of the file, zapier build worked:

const qs = require('querystring')
const https = require('https')

class AdpClient {

...

const body = qs.stringify({

...

const req = https.request(options, (res) => {

...

}

Seems like the dependency manager could do a better job of parsing the file.