serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack
MIT License
1.72k stars 417 forks source link

Process exits with success code, with no output #571

Open 0x62 opened 4 years ago

0x62 commented 4 years ago

This is a Bug Report

Description

When running via serverless webpack, serverless deploy or serverless package, the process exits with a successful status code but no bundle output.

Similar or dependent issue(s):

Additional Data

Output:

webpack.config.js:

const slsw = require('serverless-webpack');
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
const git = require('git-rev-sync');
const nodeExternals = require('webpack-node-externals');
const path = require('path');

const release = git.long();

if (!slsw.lib.webpack.isLocal) {
  console.log(`creating new sentry release ${release}`)
}

module.exports = {
  entry: slsw.lib.entries,
  target: 'node',
  // Generate sourcemaps for proper error messages
  devtool: 'source-map',
  // Since 'aws-sdk' is not compatible with webpack,
  // we exclude all node dependencies
  externals: [nodeExternals()],
  mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
  optimization: {
    // We no not want to minimize our code.
    minimize: false,
  },
  performance: {
    // Turn off size warnings for entry points
    hints: false,
  },
  // Run babel on all .js files and skip those in node_modules
  module: {
    rules: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: __dirname,
        exclude: /node_modules/,
      },
      {
        test: /\.(graphql|gql)$/,
        exclude: /node_modules/,
        loader: 'graphql-tag/loader'
      }
    ],
  },
  resolve: {
    extensions: ['*', '.js'],
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  plugins: [new SentryWebpackPlugin({
    release,
    dryRun: slsw.lib.webpack.isLocal,
    include: '.webpack',
    configFile: '.sentryconfig',
    ignore: [
      'node_modules',
      'webpack.config.js',
    ],
  })],
};

Here is the full output of SLS_DEBUG=* serverless deploy:

delta:server benlewis$ SLS_DEBUG=* serverless deploy
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command webpack
Serverless: Load command offline
Serverless: Load command offline:start
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command dev
platform-sdk fetching: POST https://api.serverless.com/core/tenants/infstream/applications/infstream/profileValue
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Invoke webpack:validate
creating new sentry release 90516059603931c39714602fb3d6c98c0536fe40
Serverless: Invoke webpack:compile
Serverless: Bundling with Webpack...
> Analyzing 8 sources
> Rewriting sources
> Adding source map references
> Analyzing 8 sources
> Rewriting sources
> Adding source map references
> Analyzing 8 sources
> ~/mux/src/webhooks/mux/index.js
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0/8
> Analyzing 8 sources
> Rewriting sources
> Adding source map references
> Bundled 8 files for upload
> Uploading release files...
███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░  128.40KB/144.33KB (0s)
> Bundled 8 files for upload
> Uploading release files...
⠉ Processing files...
> Bundling files for upload...
> Bundled 8 files for upload
> Uploading release files...
████████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  64.18KB/144.33KB (0s)
> Uploading release files...
> File upload complete

Source Map Upload Report
  Scripts
    ~/graphql/src/graphql/index.js
    ~/hasura/src/webhooks/hasura/index.js
    ~/mux/src/webhooks/mux/index.js
    ~/stripe/src/webhooks/stripe/index.js
  Source Maps
    ~/graphql/src/graphql/index.js.map
    ~/hasura/src/webhooks/hasura/index.js.map
> Uploaded release files to Sentry
> File upload complete

Source Map Upload Report
  Scripts
    ~/graphql/src/graphql/index.js
    ~/hasura/src/webhooks/hasura/index.js
    ~/mux/src/webhooks/mux/index.js
    ~/stripe/src/webhooks/stripe/index.js
  Source Maps
    ~/graphql/src/graphql/index.js.map
    ~/hasura/src/webhooks/hasura/index.js.map
> Uploaded release files to Sentry
> File upload complete

Source Map Upload Report
  Scripts
    ~/graphql/src/graphql/index.js
    ~/hasura/src/webhooks/hasura/index.js
    ~/mux/src/webhooks/mux/index.js
    ~/stripe/src/webhooks/stripe/index.js
  Source Maps
    ~/graphql/src/graphql/index.js.map
    ~/hasura/src/webhooks/hasura/index.js.map
    ~/mux/src/webhooks/mux/index.js.map
> File upload complete

Source Map Upload Report
  Scripts
    ~/graphql/src/graphql/index.js
    ~/hasura/src/webhooks/hasura/index.js
    ~/mux/src/webhooks/mux/index.js
    ~/stripe/src/webhooks/stripe/index.js
  Source Maps
    ~/graphql/src/graphql/index.js.map
    ~/hasura/src/webhooks/hasura/index.js.map
    ~/mux/src/webhooks/mux/index.js.map
    ~/stripe/src/webhooks/stripe/index.js.map
Time: 6295ms
Built at: 04/11/2020 4:35:40 PM
                   Asset     Size  Chunks                   Chunk Names
    src/graphql/index.js  136 KiB       0  [emitted]        src/graphql/index
src/graphql/index.js.map  219 KiB       0  [emitted] [dev]  src/graphql/index
Entrypoint src/graphql/index = src/graphql/index.js src/graphql/index.js.map
 [0] external "graphql-tag" 42 bytes {0} [built]
 [1] external "source-map-support/register" 42 bytes {0} [built]
 [4] external "apollo-errors" 42 bytes {0} [built]
 [8] external "jsonwebtoken" 42 bytes {0} [built]
[11] external "apollo-server-lambda" 42 bytes {0} [built]
[12] external "graphql-tools" 42 bytes {0} [built]
[13] ./src/graphql/schema/auth.gql 4.09 KiB {0} [built]
[20] ./src/graphql/schema/assets.gql 7.86 KiB {0} [built]
[25] ./src/graphql/schema/channels.gql 7.39 KiB {0} [built]
[28] ./src/graphql/schema/admin.gql 5.52 KiB {0} [built]
[29] ./src/graphql/schema/user.gql 3.39 KiB {0} [built]
[30] multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/graphql/index.js 40 bytes {0} [built]
[31] ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js 187 bytes {0} [built]
[32] external "@sentry/node" 42 bytes {0} [built]
[33] ./src/graphql/index.js + 52 modules 96 KiB {0} [built]
     | ./src/graphql/index.js 879 bytes [built]
     | ./src/shared/sentry.js 127 bytes [built]
     | ./src/shared/helpers/users.js 2.58 KiB [built]
     | ./src/graphql/schema.js 760 bytes [built]
     | ./src/shared/db/apollo.js 2.17 KiB [built]
     | ./src/shared/queries/users.js 1.42 KiB [built]
     | ./src/shared/queries/stripe.js 6.36 KiB [built]
     | ./src/graphql/resolvers/auth/index.js 477 bytes [built]
     | ./src/graphql/resolvers/assets/index.js 314 bytes [built]
     | ./src/graphql/resolvers/channels/index.js 521 bytes [built]
     | ./src/graphql/resolvers/admin/index.js 400 bytes [built]
     | ./src/graphql/resolvers/user/index.js 314 bytes [built]
     | ./src/graphql/resolvers/auth/queries/exchange-token.js 665 bytes [built]
     | ./src/graphql/resolvers/auth/queries/analytics-token.js 639 bytes [built]
     | ./src/graphql/resolvers/auth/queries/stripe-login.js 897 bytes [built]
     |     + 38 hidden modules
    + 19 hidden modules
Time: 5318ms
Built at: 04/11/2020 4:35:39 PM
                        Asset      Size  Chunks                   Chunk Names
    src/webhooks/mux/index.js  15.9 KiB       0  [emitted]        src/webhooks/mux/index
src/webhooks/mux/index.js.map  22.9 KiB       0  [emitted] [dev]  src/webhooks/mux/index
Entrypoint src/webhooks/mux/index = src/webhooks/mux/index.js src/webhooks/mux/index.js.map
 [0] external "source-map-support/register" 42 bytes {0} [built]
 [1] external "graphql-tag" 42 bytes {0} [built]
 [2] external "@mux/mux-node" 42 bytes {0} [built]
 [3] external "apollo-link" 42 bytes {0} [built]
 [4] external "@zeit/fetch" 42 bytes {0} [built]
 [5] external "apollo-client" 42 bytes {0} [built]
 [6] external "apollo-cache-inmemory" 42 bytes {0} [built]
 [7] external "apollo-link-http" 42 bytes {0} [built]
 [8] external "apollo-link-error" 42 bytes {0} [built]
 [9] external "uuid/v4" 42 bytes {0} [built]
[10] external "request" 42 bytes {0} [built]
[13] multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/webhooks/mux/index.js 40 bytes {0} [built]
[14] ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js 187 bytes {0} [built]
[15] external "@sentry/node" 42 bytes {0} [built]
[16] ./src/webhooks/mux/index.js + 7 modules 9.17 KiB {0} [built]
     | ./src/webhooks/mux/index.js 1.32 KiB [built]
     | ./src/shared/sentry.js 127 bytes [built]
     | ./src/webhooks/mux/events/asset.created.js 1.03 KiB [built]
     | ./src/webhooks/mux/events/asset.ready.js 719 bytes [built]
     | ./src/webhooks/mux/events/asset.deleted.js 375 bytes [built]
     | ./src/shared/db/apollo.js 2.17 KiB [built]
     | ./src/shared/queries/assets.js 2 KiB [built]
     | ./src/shared/helpers/assets.js 1.4 KiB [built]
    + 2 hidden modules
Time: 6261ms
Built at: 04/11/2020 4:35:40 PM
                           Asset      Size  Chunks                   Chunk Names
    src/webhooks/stripe/index.js  72.9 KiB       0  [emitted]        src/webhooks/stripe/index
src/webhooks/stripe/index.js.map   122 KiB       0  [emitted] [dev]  src/webhooks/stripe/index
Entrypoint src/webhooks/stripe/index = src/webhooks/stripe/index.js src/webhooks/stripe/index.js.map
 [0] external "graphql-tag" 42 bytes {0} [built]
 [1] external "source-map-support/register" 42 bytes {0} [built]
 [2] external "stripe" 42 bytes {0} [built]
 [5] external "apollo-link" 42 bytes {0} [built]
 [6] external "lodash" 42 bytes {0} [built]
 [7] external "@zeit/fetch" 42 bytes {0} [built]
 [8] external "apollo-client" 42 bytes {0} [built]
 [9] external "apollo-cache-inmemory" 42 bytes {0} [built]
[10] external "apollo-link-http" 42 bytes {0} [built]
[11] external "apollo-link-error" 42 bytes {0} [built]
[13] external "ioredis" 42 bytes {0} [built]
[15] multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/webhooks/stripe/index.js 40 bytes {0} [built]
[16] ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js 187 bytes {0} [built]
[17] external "@sentry/node" 42 bytes {0} [built]
[18] ./src/webhooks/stripe/index.js + 16 modules 64.9 KiB {0} [built]
     | ./src/webhooks/stripe/index.js 1.69 KiB [built]
     | ./src/shared/sentry.js 127 bytes [built]
     | ./src/shared/helpers/v2/PlatformStripeManager.js 4.59 KiB [built]
     | ./src/webhooks/stripe/events/invoice.created.js 1.63 KiB [built]
     | ./src/webhooks/stripe/events/invoice.payment_succeeded.js 1.45 KiB [built]
     | ./src/webhooks/stripe/events/invoice.payment_failed.js 126 bytes [built]
     | ./src/webhooks/stripe/events/invoice.payment_action_required.js 126 bytes [built]
     | ./src/shared/db/apollo.js 2.17 KiB [built]
     | ./src/shared/helpers/v2/InvoiceManager.js 4.2 KiB [built]
     | ./src/shared/helpers/v2/UserSubscription.js 9.93 KiB [built]
     | ./src/shared/helpers/v2/InvoiceGroup.js 2.79 KiB [built]
     | ./src/shared/helpers/v2/LockManager.js 1.88 KiB [built]
     | ./src/shared/helpers/v2/UserStripeManager.js 15.1 KiB [built]
     | ./src/shared/helpers/v2/Invoice.js 8.58 KiB [built]
     | ./src/shared/helpers/v2/InvoiceItem.js 3.15 KiB [built]
     |     + 2 hidden modules
    + 4 hidden modules
Time: 5798ms
Built at: 04/11/2020 4:35:40 PM
                           Asset      Size  Chunks                   Chunk Names
    src/webhooks/hasura/index.js  22.8 KiB       0  [emitted]        src/webhooks/hasura/index
src/webhooks/hasura/index.js.map    31 KiB       0  [emitted] [dev]  src/webhooks/hasura/index
Entrypoint src/webhooks/hasura/index = src/webhooks/hasura/index.js src/webhooks/hasura/index.js.map
 [0] external "source-map-support/register" 42 bytes {0} [built]
 [1] external "graphql-tag" 42 bytes {0} [built]
 [3] external "recombee-api-client" 42 bytes {0} [built]
 [4] external "apollo-link" 42 bytes {0} [built]
 [5] external "moment" 42 bytes {0} [built]
 [6] external "@zeit/fetch" 42 bytes {0} [built]
 [7] external "apollo-client" 42 bytes {0} [built]
 [8] external "apollo-cache-inmemory" 42 bytes {0} [built]
 [9] external "apollo-link-http" 42 bytes {0} [built]
[10] external "apollo-link-error" 42 bytes {0} [built]
[11] external "p-iteration" 42 bytes {0} [built]
[13] multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/webhooks/hasura/index.js 40 bytes {0} [built]
[14] ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js 187 bytes {0} [built]
[15] external "@sentry/node" 42 bytes {0} [built]
[16] ./src/webhooks/hasura/index.js + 10 modules 13.5 KiB {0} [built]
     | ./src/webhooks/hasura/index.js 1.01 KiB [built]
     | ./src/shared/sentry.js 127 bytes [built]
     | ./src/webhooks/hasura/events/videos/update.js 749 bytes [built]
     | ./src/webhooks/hasura/events/channels/update.js 398 bytes [built]
     | ./src/shared/helpers/recombee.js 4.02 KiB [built]
     | ./src/shared/helpers/fcm/ChannelVideoPush.js 512 bytes [built]
     | ./src/shared/db/apollo.js 2.17 KiB [built]
     | ./src/shared/queries/channels.js 1.42 KiB [built]
     | ./src/shared/queries/videos.js 1.65 KiB [built]
     | ./src/shared/helpers/fcm/GenericPush.js 1 KiB [built]
     | ./src/shared/db/firebase.js 423 bytes [built]
    + 2 hidden modules
Serverless: Invoke webpack:package
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module apollo-link
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module @types/node-fetch
Serverless: WARNING: Could not determine version of module node-fetch
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module apollo-link
Serverless: WARNING: Could not determine version of module @types/node-fetch
Serverless: WARNING: Could not determine version of module node-fetch
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module apollo-link
Serverless: WARNING: Could not determine version of module lodash
Serverless: WARNING: Could not determine version of module @types/node-fetch
Serverless: WARNING: Could not determine version of module node-fetch
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module apollo-link
Serverless: WARNING: Could not determine version of module @types/node-fetch
Serverless: WARNING: Could not determine version of module node-fetch
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: Package lock found - Using locked versions
Serverless: Packing external modules: graphql-tag@^2.10.1, graphql, source-map-support@^0.5.16, stripe@^7.14.0, uuid@^3.3.3, apollo-errors@^1.9.0, @mux/mux-node@^2.5.0, firebase-admin@^8.8.0, p-iteration@^1.1.8, jsonwebtoken@^8.5.1, apollo-link, dinero.js@^1.6.0, apollo-server-lambda@^2.9.12, graphql-tools@^4.0.6, @zeit/fetch@^5.1.1, @types/node-fetch, node-fetch, apollo-client@^2.6.4, apollo-cache-inmemory@^1.6.3, apollo-link-http@^1.5.16, apollo-link-error@^1.1.12, request@^2.88.0, aws-sdk@^2.585.0, aws-s3-form@^0.3.5, ioredis@^4.16.1, redlock@^4.1.0, @sentry/node@^5.15.4, lodash, moment@^2.24.0, recombee-api-client@^2.4.1
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module apollo-link
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module @types/node-fetch
Serverless: WARNING: Could not determine version of module node-fetch
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
Serverless: WARNING: Could not determine version of module graphql
delta:server benlewis$
0x62 commented 4 years ago

package.json:

  "devDependencies": {
    "@babel/cli": "^7.7.4",
    "@babel/core": "^7.7.4",
    "@babel/preset-env": "^7.7.4",
    "babel-loader": "^8.0.6",
    "babel-plugin-module-resolver": "^3.2.0",
    "babel-plugin-source-map-support": "^2.1.1",
    "eslint-import-resolver-babel-module": "^5.1.0",
    "serverless-dotenv-plugin": "^2.1.1",
    "serverless-offline": "^5.12.0",
    "serverless-webpack": "5.3.1",
    "webpack": "^4.41.2",
    "webpack-node-externals": "^1.7.2"
  },
  "dependencies": {
    "@mux/mux-node": "^2.5.0",
    "@sentry/node": "^5.15.4",
    "@sentry/webpack-plugin": "^1.10.0",
    "@zeit/fetch": "^5.1.1",
    "apollo-cache-inmemory": "^1.6.3",
    "apollo-client": "^2.6.4",
    "apollo-errors": "^1.9.0",
    "apollo-link-error": "^1.1.12",
    "apollo-link-http": "^1.5.16",
    "apollo-server-lambda": "^2.9.12",
    "aws-s3-form": "^0.3.5",
    "aws-sdk": "^2.585.0",
    "dinero.js": "^1.6.0",
    "firebase-admin": "^8.8.0",
    "git-rev-sync": "^2.0.0",
    "graphql-tag": "^2.10.1",
    "graphql-tools": "^4.0.6",
    "i": "^0.3.6",
    "ioredis": "^4.16.1",
    "jsonwebtoken": "^8.5.1",
    "moment": "^2.24.0",
    "npm": "^6.14.4",
    "p-iteration": "^1.1.8",
    "recombee-api-client": "^2.4.1",
    "redlock": "^4.1.0",
    "request": "^2.88.0",
    "source-map-support": "^0.5.16",
    "stream": "0.0.2",
    "stripe": "^7.14.0",
    "uuid": "^3.3.3"
  }

serverless.yml (functions/resources redacted):

# Custom config options
custom:
  webpack:
    includeModules: true
  config: ${file(env.${self:provider.stage}.yml)}

# Provider configuration
provider:
  name: aws
  runtime: nodejs12.x
  stage: ${opt:stage, 'dev'}
  region: us-east-1
  environment: ${self:custom.config}

# Plugins
plugins:
  - serverless-webpack
  - serverless-offline

# Package each function individually
package:
  individually: true
soda0289 commented 4 years ago

What kind of output are you expecting?

serverless package will create zip packages in the folder .serverless

Are you saying those zip folders are empty or are there no zipped packages at all?

0x62 commented 4 years ago

@soda0289 Empty except for the CloudFormation template, no zipped packages at all. No console messages, ends at the same point as the log above.

I've tried reverting to a known good commit from last week, and get the same result. Current line of thinking is possibly related to a dependency that has introduced a bug in a minor update?

Tested removing the Sentry plugin, no luck.

Builds successfully with custom.webpack.includeModules: false, but throws an error at runtime (serverless/serverless#7566).

soda0289 commented 4 years ago

This problem might be related to an uncaught promise rejection or some race condition between promises.

The includeModules flags just tells this plugin to run npm/yarn to create the node_modules folder for each zip bundle. If you wanted to set includeModules to false you would need to bundle in all the external modules, by remove externals: [nodeExternals()] from webpack config. This might be a workaround for you or other people with this issue.

I will look into this and try to reproduce the issue. Are those warnings about "Could not determine version of module" a normal thing or did it start to happen when builds stared to failed?

soda0289 commented 4 years ago
Serverless: Packing external modules: 
 graphql-tag@^2.10.1,
 graphql,
 source-map-support@^0.5.16,
 stripe@^7.14.0,
 uuid@^3.3.3,
 apollo-errors@^1.9.0,
 @mux/mux-node@^2.5.0,
 firebase-admin@^8.8.0,
 p-iteration@^1.1.8,
 jsonwebtoken@^8.5.1,
 apollo-link,
 dinero.js@^1.6.0,
 apollo-server-lambda@^2.9.12,
 graphql-tools@^4.0.6,
 @zeit/fetch@^5.1.1,
 @types/node-fetch,
 node-fetch,
 apollo-client@^2.6.4,
 apollo-cache-inmemory@^1.6.3,
 apollo-link-http@^1.5.16,
 apollo-link-error@^1.1.12,
 request@^2.88.0,
 aws-sdk@^2.585.0,
 aws-s3-form@^0.3.5,
 ioredis@^4.16.1,
 redlock@^4.1.0,
 @sentry/node@^5.15.4,
 lodash,
 moment@^2.24.0,
 recombee-api-client@^2.4.1

It seems to be missing versions for packages graphql, apollo-link, node-fetch, lodash. Which might be peer dependencies of some of your packcages, such as @zeit/fetch or apollo-client. You can try adding the missing peer dependencies and see if that fixes the issue or eliminates the warnings.

0x62 commented 4 years ago

@soda0289 Cheers for your help. Could not determine version messages have been there as long as I can remember, and never caused issues.

Building with includeModules: false, and removing externals throws errors at package with the following log:

ERROR in ./node_modules/graphql/index.mjs 42:0-48:205
Can't reexport the named export 'BREAK' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql-tools/dist/makeExecutableSchema.js
 @ ./node_modules/graphql-tools/dist/index.js
 @ ./src/graphql/schema.js
 @ ./src/graphql/index.js
 @ multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/graphql/index.js

[many similar (default export only) errors omitted]

ERROR in ./node_modules/google-gax/build/src/operationsClient.js
Module not found: Error: Can't resolve './operations_client_config' in '/Users/benlewis/projects/hearsay/server/node_modules/google-gax/build/src'
 @ ./node_modules/google-gax/build/src/operationsClient.js 36:19-56
 @ ./node_modules/google-gax/build/src/index.js
 @ ./node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js
 @ ./node_modules/@google-cloud/firestore/build/src/v1/index.js
 @ ./node_modules/@google-cloud/firestore/build/src/index.js
 @ ./node_modules/firebase-admin/lib/firebase-namespace.js
 @ ./node_modules/firebase-admin/lib/default-namespace.js
 @ ./node_modules/firebase-admin/lib/index.js
 @ ./src/shared/db/firebase.js
 @ ./src/graphql/resolvers/auth/mutations/password-reset.js
 @ ./src/graphql/resolvers/auth/index.js
 @ ./src/graphql/schema.js
 @ ./src/graphql/index.js
 @ multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/graphql/index.js

ERROR in ./node_modules/@firebase/database/dist/index.esm.js
Module not found: Error: Can't resolve '@firebase/app' in '/Users/benlewis/projects/hearsay/server/node_modules/@firebase/database/dist'
 @ ./node_modules/@firebase/database/dist/index.esm.js 1:0-37 15117:17-25
 @ ./node_modules/firebase-admin/lib/firebase-namespace.js
 @ ./node_modules/firebase-admin/lib/default-namespace.js
 @ ./node_modules/firebase-admin/lib/index.js
 @ ./src/shared/db/firebase.js
 @ ./src/graphql/resolvers/auth/mutations/password-reset.js
 @ ./src/graphql/resolvers/auth/index.js
 @ ./src/graphql/schema.js
 @ ./src/graphql/index.js
 @ multi ./node_modules/@sentry/webpack-plugin/src/sentry-webpack.module.js ./src/graphql/index.js

I've installed specific versions of the packages, but no changes to the output:

delta:server benlewis$ npm i -s graphql apollo-link node-fetch lodash
+ lodash@4.17.15
+ graphql@15.0.0
+ node-fetch@2.6.0
+ apollo-link@1.2.14
0x62 commented 4 years ago

I've been able to track down the package causing the issue.

Requiring git-rev-sync in webpack.config.js is what's causing it to silently fail.

Here is a demo app showing the issue: sls-err.zip. Running with $ serverless offline will build successfully and launch a GraphQL server, which you can query ping { pong }.

Attempting to use deploy/package with webpack.config.js#L6 uncommented will fail silently.

mrowles commented 3 years ago

I have 3 serverless repo's all with the same config, more or less. The first two that got this error are substantially smaller in size, and somehow eventually began running fine after a few CI/CD reruns. I checked the logs, cleared caches and made sure everything is as expected. I can't explain this.

However, the larger repository (which also uses a copy-webpack-plugin) cannot overcome this error.

"serverless": "2.43.1",
"serverless-webpack": "5.5.0",
"webpack": "5.38.1",
"webpack-cli": "4.7.2",
"webpack-node-externals": "3.0.0"