10

I have an angular universal app. During build I am getting all kinds of errors after trying to use firebase-admin on the server. For some reason i can get the server to build when firebase-admin is required.

build angular unversal server

webpack --config webpack.server.config.js --progress --colors

errors

WARNING in ./node_modules/hash-stream-validation/index.js Module not found: Error: Can't resolve 'fast-crc32c' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/hash-stream-validation'

WARNING in ./node_modules/bytebuffer/dist/bytebuffer-node.js Module not found: Error: Can't resolve 'memcpy' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/bytebuffer/dist'

ERROR in ./node_modules/@grpc/grpc-js/build/src/channel.js Module not found: Error: Can't resolve '../../package' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/@grpc/grpc-js/build/src'

ERROR in ./node_modules/@google-cloud/firestore/build/src/v1beta1/firestore_client.js Module not found: Error: Can't resolve './firestore_client_config' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/@google-cloud/firestore/build/src/v1beta1'

ERROR in ./node_modules/google-gax/build/src/operations_client.js Module not found: Error: Can't resolve './operations_client_config' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/google-gax/build/src'

ERROR in ./node_modules/@google-cloud/storage/node_modules/mime/index.js Module not found: Error: Can't resolve './types/other' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/@google-cloud/storage/node_modules/mime'

ERROR in ./node_modules/gtoken/node_modules/mime/index.js Module not found: Error: Can't resolve './types/other' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/gtoken/node_modules/mime'

ERROR in ./node_modules/@google-cloud/storage/node_modules/mime/index.js Module not found: Error: Can't resolve './types/standard' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/@google-cloud/storage/node_modules/mime'

ERROR in ./node_modules/gtoken/node_modules/mime/index.js Module not found: Error: Can't resolve './types/standard' in '/Users/ohabash/Dropbox/Sites/fornida-ng6/node_modules/gtoken/node_modules/mime'

I think something like this might be a good solution but i dont know webpack that well. https://stackoverflow.com/a/44450118/3066142

this was also good info. but nothing helpful. If i cannot compile with webpack then what is another way of doing this? https://github.com/googleapis/google-cloud-node/issues/1821


update I modified webpack.server.config.js so node_modules do not bundle.

const nodeExternals = require('webpack-node-externals');

module.exports = {
   ...
   externals: [nodeExternals()],
   ...
}

i think that fixed the problem above because the app was able to bundle without error. But now when i run the build there is an error at run time

Error: Cannot find module 'zone.js/dist/zone-node'

Omar
  • 2,726
  • 2
  • 32
  • 65

0 Answers0