zapier/zapier-platform-cli

`zapier build` skips a lot of source code

Closed this issue · 2 comments

What would you like to change?

I get an error when running actions from a newly created zap

Cannot find module './src'

Stack trace:
  Function.Module._load (module.js:417:25)
  Module.require (module.js:497:17)
  require (internal/module.js:20:19)
  Object.<anonymous> (/var/task/node_modules/zapier-platform-core/index.js:1:78)
  Module._compile (module.js:570:32)
  Object.Module._extensions..js (module.js:579:10)
  Module.load (module.js:487:32)
  tryModuleLoad (module.js:446:12)
  Function.Module._load (module.js:438:3)

Your Environment

$zapier build --debug
Building project.

✔ Copying project to temp directory
⠋ Installing project dependencies

Running npm install --production command in /private/var/folders/_5/ywf7j5w93r98yybjnym9yzdc0000gn/T/zapier-412a1e78:

⠇ Installing project dependencieszapier-platform-example-app-minimal@1.0.0 /private/var/folders/_5/ywf7j5w93r98yybjnym9yzdc0000gn/T/zapier-412a1e78
└─┬ zapier-platform-core@6.1.0
  ├── bluebird@3.5.0
  ├── content-disposition@0.5.2
  ├── dotenv@5.0.1
  ├─┬ form-data@2.2.0
  │ ├── asynckit@0.4.0
  │ ├─┬ combined-stream@1.0.6
  │ │ └── delayed-stream@1.0.0
  │ └─┬ mime-types@2.1.18
  │   └── mime-db@1.33.0
  ├── lodash@4.17.10
  ├─┬ node-fetch@1.7.1
  │ ├─┬ encoding@0.1.12
  │ │ └─┬ iconv-lite@0.4.23
  │ │   └── safer-buffer@2.1.2
  │ └── is-stream@1.1.0
  └─┬ zapier-platform-schema@6.1.0
    └── jsonschema@1.1.1

✔ Installing project dependencies
✔ Applying entry point file
✔ Building app definition.json
⠼ Validating project>> POST https://zapier.com/api/platform/cli/style-check
>> {"version":"1.0.0","platformVersion":"6.1.0","beforeRequest":[],"afterResponse":[],"resources":{},"triggers":{},"searches":{},"creates":{"dailyReport":{"key":"dailyReport","noun":"Daily Report","display":{"label":"Create Daily Report","description":"Creates a new daily report."},"operation":{"inputFields":[{"key":"today","required":true,"type":"datetime"},{"key":"big_goal","label":"Big Goal","required":true,"type":"text","helpText":"What is the one major goal nowadays?"},{"key":"weather_forecast","label":"Weather Forecast","type":"text"},{"key":"weather_icon","label":"Weather Icon","type":"text"},{"key":"horoscope","label":"Horoscope","type":"text"},{"key":"daily_comic","label":"Comic img url","type":"text"},{"key":"carbs","label":"Carbs","type":"text"},{"key":"protein","label":"Protein","type":"text"},{"key":"fat","label":"Fat","type":"text"},{"key":"calories","label":"Calories","type":"text"}],"perform":"$func$2$f$","sample":{"id":"12345","html":"Some html content here <b>wow!</b>"},"outputFields":[{"key":"id","label":"ID"},{"key":"html","label":"HTML"}]}}},"searchOrCreates":{},"zip_file":"raw zip removed in logs"}
<< 200
<< {"errors": {}, "warnings": {}}

✔ Validating project
⠹ Zipping project and dependencies
Zip files:
  definition.json
  index.js
  node_modules/asynckit/package.json
  node_modules/bluebird/package.json
  node_modules/combined-stream/package.json
  node_modules/content-disposition/package.json
  node_modules/delayed-stream/package.json
  node_modules/dotenv/package.json
  node_modules/encoding/package.json
  node_modules/form-data/package.json
  node_modules/iconv-lite/package.json
  node_modules/is-stream/package.json
  node_modules/jsonschema/package.json
  node_modules/lodash/package.json
  node_modules/mime-db/package.json
  node_modules/mime-types/package.json
  node_modules/node-fetch/package.json
  node_modules/safer-buffer/package.json
  node_modules/zapier-platform-core/boilerplate/definition.json
  node_modules/zapier-platform-core/boilerplate/package.json
  node_modules/zapier-platform-core/index.js
  node_modules/zapier-platform-core/package.json
  node_modules/zapier-platform-schema/examples/definition.json
  node_modules/zapier-platform-schema/package.json
  package.json
  zapierwrapper.js

⠼ Zipping project and dependencies
Source Zip files:
  .travis.yml
  .zapierapprc
  creates/createDailyReport.js
  definition.json
  index.js
  package.json
  test/createDailyReport.js
  test/index.js
  zapierwrapper.js

✔ Zipping project and dependencies
⠋ Testing build

Running find . -exec touch -t 201601010000 {} + command in /private/var/folders/_5/ywf7j5w93r98yybjnym9yzdc0000gn/T/zapier-412a1e78:

✔ Testing build
✔ Cleaning up temp directory
  • CLI Version (zapier -v):
zapier-platform-cli/6.1.0
zapier-platform-core/6.1.0
node/v6.10.2
  • Operating System and version:
system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.13.5 (17F77)
      Kernel Version: Darwin 17.6.0

Everything works locally, but the uploaded version is missing the src folder.

screen shot 2018-06-15 at 10 38 27 pm

screen shot 2018-06-15 at 10 39 30 pm

Hmm, so the issue is that build isn't correctly walking the tree for dependencies. I wasn't able to reproduce, but attached is my output list.

Note that I'm getting a ton more files. Most importantly, I'm getting the src directory in zapier-platform-core. Your error is coming from this line.

@HarrisonJackson (or anyone else experiencing this) can you post your app id (found in .zapierapprc) and I can see if I can repro with your code?

In the meantime, you can use zapier build --disable-dependency-detection, which should include everything and work as expected.


Build Log
Zip files:
  creates/report.js
  definition.json
  index.js
  node_modules/asynckit/index.js
  node_modules/asynckit/lib/abort.js
  node_modules/asynckit/lib/async.js
  node_modules/asynckit/lib/defer.js
  node_modules/asynckit/lib/iterate.js
  node_modules/asynckit/lib/state.js
  node_modules/asynckit/lib/terminator.js
  node_modules/asynckit/package.json
  node_modules/asynckit/parallel.js
  node_modules/asynckit/serial.js
  node_modules/asynckit/serialOrdered.js
  node_modules/bluebird/js/release/any.js
  node_modules/bluebird/js/release/async.js
  node_modules/bluebird/js/release/bind.js
  node_modules/bluebird/js/release/bluebird.js
  node_modules/bluebird/js/release/call_get.js
  node_modules/bluebird/js/release/cancel.js
  node_modules/bluebird/js/release/catch_filter.js
  node_modules/bluebird/js/release/context.js
  node_modules/bluebird/js/release/debuggability.js
  node_modules/bluebird/js/release/direct_resolve.js
  node_modules/bluebird/js/release/each.js
  node_modules/bluebird/js/release/errors.js
  node_modules/bluebird/js/release/es5.js
  node_modules/bluebird/js/release/filter.js
  node_modules/bluebird/js/release/finally.js
  node_modules/bluebird/js/release/generators.js
  node_modules/bluebird/js/release/join.js
  node_modules/bluebird/js/release/map.js
  node_modules/bluebird/js/release/method.js
  node_modules/bluebird/js/release/nodeback.js
  node_modules/bluebird/js/release/nodeify.js
  node_modules/bluebird/js/release/promise.js
  node_modules/bluebird/js/release/promise_array.js
  node_modules/bluebird/js/release/promisify.js
  node_modules/bluebird/js/release/props.js
  node_modules/bluebird/js/release/queue.js
  node_modules/bluebird/js/release/race.js
  node_modules/bluebird/js/release/reduce.js
  node_modules/bluebird/js/release/schedule.js
  node_modules/bluebird/js/release/settle.js
  node_modules/bluebird/js/release/some.js
  node_modules/bluebird/js/release/synchronous_inspection.js
  node_modules/bluebird/js/release/thenables.js
  node_modules/bluebird/js/release/timers.js
  node_modules/bluebird/js/release/using.js
  node_modules/bluebird/js/release/util.js
  node_modules/bluebird/package.json
  node_modules/combined-stream/lib/combined_stream.js
  node_modules/combined-stream/lib/defer.js
  node_modules/combined-stream/package.json
  node_modules/content-disposition/index.js
  node_modules/content-disposition/package.json
  node_modules/delayed-stream/lib/delayed_stream.js
  node_modules/delayed-stream/package.json
  node_modules/dotenv/lib/main.js
  node_modules/dotenv/package.json
  node_modules/encoding/lib/encoding.js
  node_modules/encoding/lib/iconv-loader.js
  node_modules/encoding/package.json
  node_modules/form-data/lib/form_data.js
  node_modules/form-data/lib/populate.js
  node_modules/form-data/package.json
  node_modules/iconv-lite/encodings/dbcs-codec.js
  node_modules/iconv-lite/encodings/dbcs-data.js
  node_modules/iconv-lite/encodings/index.js
  node_modules/iconv-lite/encodings/internal.js
  node_modules/iconv-lite/encodings/sbcs-codec.js
  node_modules/iconv-lite/encodings/sbcs-data-generated.js
  node_modules/iconv-lite/encodings/sbcs-data.js
  node_modules/iconv-lite/encodings/tables/big5-added.json
  node_modules/iconv-lite/encodings/tables/cp936.json
  node_modules/iconv-lite/encodings/tables/cp949.json
  node_modules/iconv-lite/encodings/tables/cp950.json
  node_modules/iconv-lite/encodings/tables/eucjp.json
  node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
  node_modules/iconv-lite/encodings/tables/gbk-added.json
  node_modules/iconv-lite/encodings/tables/shiftjis.json
  node_modules/iconv-lite/encodings/utf16.js
  node_modules/iconv-lite/encodings/utf7.js
  node_modules/iconv-lite/lib/bom-handling.js
  node_modules/iconv-lite/lib/extend-node.js
  node_modules/iconv-lite/lib/index.js
  node_modules/iconv-lite/lib/streams.js
  node_modules/iconv-lite/package.json
  node_modules/is-stream/index.js
  node_modules/is-stream/package.json
  node_modules/jsonschema/lib/attribute.js
  node_modules/jsonschema/lib/helpers.js
  node_modules/jsonschema/lib/index.js
  node_modules/jsonschema/lib/validator.js
  node_modules/jsonschema/package.json
  node_modules/lodash/lodash.js
  node_modules/lodash/package.json
  node_modules/mime-db/db.json
  node_modules/mime-db/index.js
  node_modules/mime-db/package.json
  node_modules/mime-types/index.js
  node_modules/mime-types/package.json
  node_modules/node-fetch/index.js
  node_modules/node-fetch/lib/body.js
  node_modules/node-fetch/lib/fetch-error.js
  node_modules/node-fetch/lib/headers.js
  node_modules/node-fetch/lib/request.js
  node_modules/node-fetch/lib/response.js
  node_modules/node-fetch/package.json
  node_modules/safer-buffer/package.json
  node_modules/safer-buffer/safer.js
  node_modules/zapier-platform-core/boilerplate/definition.json
  node_modules/zapier-platform-core/boilerplate/package.json
  node_modules/zapier-platform-core/index.js
  node_modules/zapier-platform-core/package.json
  node_modules/zapier-platform-core/src/app-middlewares/after/checks.js
  node_modules/zapier-platform-core/src/app-middlewares/after/large-response-cacher.js
  node_modules/zapier-platform-core/src/app-middlewares/after/wait-for-promises.js
  node_modules/zapier-platform-core/src/app-middlewares/before/add-app-context.js
  node_modules/zapier-platform-core/src/app-middlewares/before/z-object.js
  node_modules/zapier-platform-core/src/checks/create-is-object.js
  node_modules/zapier-platform-core/src/checks/index.js
  node_modules/zapier-platform-core/src/checks/is-create.js
  node_modules/zapier-platform-core/src/checks/is-search.js
  node_modules/zapier-platform-core/src/checks/is-trigger.js
  node_modules/zapier-platform-core/src/checks/search-is-array.js
  node_modules/zapier-platform-core/src/checks/trigger-has-id.js
  node_modules/zapier-platform-core/src/checks/trigger-has-unique-ids.js
  node_modules/zapier-platform-core/src/checks/trigger-is-array.js
  node_modules/zapier-platform-core/src/checks/trigger-is-object.js
  node_modules/zapier-platform-core/src/constants.js
  node_modules/zapier-platform-core/src/create-app.js
  node_modules/zapier-platform-core/src/create-command-handler.js
  node_modules/zapier-platform-core/src/errors.js
  node_modules/zapier-platform-core/src/execute-request.js
  node_modules/zapier-platform-core/src/execute.js
  node_modules/zapier-platform-core/src/http-middlewares/after/log-response.js
  node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js
  node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-stale-auth.js
  node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js
  node_modules/zapier-platform-core/src/http-middlewares/before/add-basic-auth-header.js
  node_modules/zapier-platform-core/src/http-middlewares/before/add-query-params.js
  node_modules/zapier-platform-core/src/http-middlewares/before/inject-input.js
  node_modules/zapier-platform-core/src/http-middlewares/before/prepare-request.js
  node_modules/zapier-platform-core/src/index.js
  node_modules/zapier-platform-core/src/middleware.js
  node_modules/zapier-platform-core/src/tools/cleaner.js
  node_modules/zapier-platform-core/src/tools/create-app-request-client.js
  node_modules/zapier-platform-core/src/tools/create-app-tester.js
  node_modules/zapier-platform-core/src/tools/create-dehydrator.js
  node_modules/zapier-platform-core/src/tools/create-file-stasher.js
  node_modules/zapier-platform-core/src/tools/create-http-patch.js
  node_modules/zapier-platform-core/src/tools/create-input.js
  node_modules/zapier-platform-core/src/tools/create-json-tool.js
  node_modules/zapier-platform-core/src/tools/create-lambda-handler.js
  node_modules/zapier-platform-core/src/tools/create-legacy-scripting-runner.js
  node_modules/zapier-platform-core/src/tools/create-logger-console.js
  node_modules/zapier-platform-core/src/tools/create-logger.js
  node_modules/zapier-platform-core/src/tools/create-request-client.js
  node_modules/zapier-platform-core/src/tools/create-rpc-client.js
  node_modules/zapier-platform-core/src/tools/create-storekey-tool.js
  node_modules/zapier-platform-core/src/tools/data.js
  node_modules/zapier-platform-core/src/tools/ensure-array.js
  node_modules/zapier-platform-core/src/tools/ensure-path.js
  node_modules/zapier-platform-core/src/tools/envelope.js
  node_modules/zapier-platform-core/src/tools/environment.js
  node_modules/zapier-platform-core/src/tools/exported.js
  node_modules/zapier-platform-core/src/tools/fetch.js
  node_modules/zapier-platform-core/src/tools/hashing.js
  node_modules/zapier-platform-core/src/tools/memoize.js
  node_modules/zapier-platform-core/src/tools/memory-checker.js
  node_modules/zapier-platform-core/src/tools/plain/index.js
  node_modules/zapier-platform-core/src/tools/promise.js
  node_modules/zapier-platform-core/src/tools/request-clean.js
  node_modules/zapier-platform-core/src/tools/request-client-internal.js
  node_modules/zapier-platform-core/src/tools/request-client.js
  node_modules/zapier-platform-core/src/tools/request-merge.js
  node_modules/zapier-platform-core/src/tools/request-sugar.js
  node_modules/zapier-platform-core/src/tools/resolve-method-path.js
  node_modules/zapier-platform-core/src/tools/response-cleaner.js
  node_modules/zapier-platform-core/src/tools/schema-tools.js
  node_modules/zapier-platform-core/src/tools/schema.js
  node_modules/zapier-platform-schema/examples/definition.json
  node_modules/zapier-platform-schema/lib/constants.js
  node_modules/zapier-platform-schema/lib/functional-constraints/deepNestedFields.js
  node_modules/zapier-platform-schema/lib/functional-constraints/index.js
  node_modules/zapier-platform-schema/lib/functional-constraints/matchingKeys.js
  node_modules/zapier-platform-schema/lib/functional-constraints/mutuallyExclusiveFields.js
  node_modules/zapier-platform-schema/lib/functional-constraints/requiredSamples.js
  node_modules/zapier-platform-schema/lib/functional-constraints/searchOrCreateKeys.js
  node_modules/zapier-platform-schema/lib/schemas/AppSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationBasicConfigSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationCustomConfigSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationDigestConfigSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationOAuth2ConfigSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/AuthenticationSessionConfigSchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicActionOperationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicCreateActionOperationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicDisplaySchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicHookOperationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicOperationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/BasicPollingOperationSchema.js
  node_modules/zapier-platform-schema/lib/schemas/CreateSchema.js
  node_modules/zapier-platform-schema/lib/schemas/CreatesSchema.js
  node_modules/zapier-platform-schema/lib/schemas/DynamicFieldsSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FieldChoiceWithLabelSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FieldChoicesSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FieldOrFunctionSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FieldSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FieldsSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FlatObjectSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FunctionRequireSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FunctionSchema.js
  node_modules/zapier-platform-schema/lib/schemas/FunctionSourceSchema.js
  node_modules/zapier-platform-schema/lib/schemas/HydratorsSchema.js
  node_modules/zapier-platform-schema/lib/schemas/KeySchema.js
  node_modules/zapier-platform-schema/lib/schemas/MiddlewaresSchema.js
  node_modules/zapier-platform-schema/lib/schemas/RedirectRequestSchema.js
  node_modules/zapier-platform-schema/lib/schemas/RefResourceSchema.js
  node_modules/zapier-platform-schema/lib/schemas/RequestSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceMethodCreateSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceMethodGetSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceMethodHookSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceMethodListSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceMethodSearchSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourceSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResourcesSchema.js
  node_modules/zapier-platform-schema/lib/schemas/ResultsSchema.js
  node_modules/zapier-platform-schema/lib/schemas/SearchOrCreateSchema.js
  node_modules/zapier-platform-schema/lib/schemas/SearchOrCreatesSchema.js
  node_modules/zapier-platform-schema/lib/schemas/SearchSchema.js
  node_modules/zapier-platform-schema/lib/schemas/SearchesSchema.js
  node_modules/zapier-platform-schema/lib/schemas/TriggerSchema.js
  node_modules/zapier-platform-schema/lib/schemas/TriggersSchema.js
  node_modules/zapier-platform-schema/lib/schemas/VersionSchema.js
  node_modules/zapier-platform-schema/lib/utils/exportSchema.js
  node_modules/zapier-platform-schema/lib/utils/links.js
  node_modules/zapier-platform-schema/lib/utils/makeSchema.js
  node_modules/zapier-platform-schema/lib/utils/makeValidator.js
  node_modules/zapier-platform-schema/package.json
  node_modules/zapier-platform-schema/schema.js
  package.json
  zapierwrapper.js

ok, so given that this hasn't come back up and we haven't had any other reports of it, i'm going to close it out. If it pops up again, definitely re-open it!