Stack Exchange
Getting an issue while integrating google-cloud with webpack
I am integrating the google-cloud npm package with my react application and i am using firebase.
Errors i am encountering -

WARNING in ./~/google-cloud/~/hash-stream-validation/index.js Module
  not found: Error: Can't resolve 'fast-crc32c' in
  '/home/linuxbox/React-Workspace/Kaptify/node_modules/google-cloud/node_modules/hash-stream-validation'
  @ ./~/google-cloud/~/hash-stream-validation/index.js 5:8-30  @
  ./~/google-cloud/~/@google-cloud/storage/src/file.js  @
  ./~/google-cloud/~/@google-cloud/storage/src/index.js  @
  ./~/google-cloud/src/index.js  @ ./src/actions/UserStateStore.js  @
  ./app.js  @ multi (webpack)-dev-server/client?http://127.0.0.1:3000
  webpack/hot/dev-server ./app.js
WARNING in ./~/google-cloud/~/google-auto-auth/index.js 53:13-58
  Critical dependency: the request of a dependency is an expression
WARNING in ./~/google-cloud/~/grpc/src/node/src/grpc_extension.js
  38:14-35 Critical dependency: the request of a dependency is an
  expression
WARNING in ./~/google-cloud/~/node-pre-gyp/lib/pre-binding.js 19:22-48
  Critical dependency: the request of a dependency is an expression
WARNING in ./~/google-cloud/~/node-pre-gyp/lib/util/versioning.js
  15:20-67 Critical dependency: the request of a dependency is an
  expression

Can anybody help me to resolve this?

Do you use google-cloud in frontend code or backend code? If it's frontend, you probably want to use this library: https://developers.google.com/api-client-library/javascript/start/start-js

I see you're using webpack, and I'm assuming you're using the google-cloud library in the backend. 
Try putting this in your webpack config:
config = {
    // ...
    externals: {
        '@google-cloud/storage': 'commonjs @google-cloud/storage'
    },
    // ...
}

Explanation
Modules meant for the backend aren't really made with the intention of them being bundled (see: Backend Apps with Webpack). So we use webpack's externals config to exclude libraries that don't handle that bundling well. When the app is run, they are just require()'ed from the node_modules directory as normal.
If you don't want to specify your offending modules one-by-one, try out webpack-node-externals to automatically exclude all modules.

How does this solve the issue? When you take the webpacked javascript elsewhere it won't work due to missing modules

@OdedNiv If you do this for a library you're making, you'll need to have the packages you exclude listed in dependencies in package.json so anything consuming your library also downloads the necessary modules.

He says he is integrating google-cloud with his "react application", which is the opposite of a library
