-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error when building firebase-admin #317
Comments
The underlying error here is in google-gax, in this file - https://unpkg.com/[email protected]/build/src/grpc.js. The code that is causing the problem is: // INCLUDE_DIRS is passed to @grpc/proto-loader
const INCLUDE_DIRS = [];
INCLUDE_DIRS.push(googleProtoFilesDir);
// COMMON_PROTO_FILES logic is here for protobufjs loads (see
// GoogleProtoFilesRoot below)
const COMMON_PROTO_DIRS = [
// This list of directories is defined here:
// https://github.com/googleapis/googleapis/blob/master/gapic/packaging/common_protos.yaml
'api',
path.join('iam', 'v1'),
path.join('logging', 'type'),
path.join('monitoring', 'v3'),
'longrunning',
'protobuf',
'rpc',
'type',
].map(dir => path.join(googleProtoFilesDir, 'google', dir));
INCLUDE_DIRS.push(...COMMON_PROTO_DIRS);
const COMMON_PROTO_FILES = COMMON_PROTO_DIRS
.map(dir => {
return walk.sync(dir)
.filter(f => path.extname(f) === '.proto')
.map(f => path.normalize(f).substring(googleProtoFilesDir.length + 1));
})
.reduce((a, c) => a.concat(c), []); where There is no general analysis fix unfortunately here, so like the express templates case, we need to work out what is a specific fix we can inline for this exact package to make things work out ok. If I run this on my machine, I get [ 'google/api/annotations.proto',
'google/api/auth.proto',
'google/api/backend.proto',
'google/api/billing.proto',
'google/api/client.proto',
'google/api/config_change.proto',
'google/api/consumer.proto',
'google/api/context.proto',
'google/api/control.proto',
'google/api/distribution.proto',
'google/api/documentation.proto',
'google/api/endpoint.proto',
'google/api/experimental/authorization_config.proto',
'google/api/experimental/experimental.proto',
'google/api/expr/v1alpha1/cel_service.proto',
'google/api/expr/v1alpha1/checked.proto',
'google/api/expr/v1alpha1/conformance_service.proto',
'google/api/expr/v1alpha1/eval.proto',
'google/api/expr/v1alpha1/explain.proto',
'google/api/expr/v1alpha1/syntax.proto',
'google/api/expr/v1alpha1/value.proto',
'google/api/expr/v1beta1/decl.proto',
'google/api/expr/v1beta1/eval.proto',
'google/api/expr/v1beta1/expr.proto',
'google/api/expr/v1beta1/source.proto',
'google/api/expr/v1beta1/value.proto',
'google/api/field_behavior.proto',
'google/api/http.proto',
'google/api/httpbody.proto',
'google/api/label.proto',
'google/api/launch_stage.proto',
'google/api/log.proto',
'google/api/logging.proto',
'google/api/metric.proto',
'google/api/monitored_resource.proto',
'google/api/monitoring.proto',
'google/api/quota.proto',
'google/api/resource.proto',
'google/api/service.proto',
'google/api/servicecontrol/v1/check_error.proto',
'google/api/servicecontrol/v1/distribution.proto',
'google/api/servicecontrol/v1/log_entry.proto',
'google/api/servicecontrol/v1/metric_value.proto',
'google/api/servicecontrol/v1/operation.proto',
'google/api/servicecontrol/v1/quota_controller.proto',
'google/api/servicecontrol/v1/service_controller.proto',
'google/api/servicemanagement/v1/resources.proto',
'google/api/servicemanagement/v1/servicemanager.proto',
'google/api/source_info.proto',
'google/api/system_parameter.proto',
'google/api/usage.proto',
'google/iam/v1/iam_policy.proto',
'google/iam/v1/logging/audit_data.proto',
'google/iam/v1/policy.proto',
'google/logging/type/http_request.proto',
'google/logging/type/log_severity.proto',
'google/monitoring/v3/alert.proto',
'google/monitoring/v3/alert_service.proto',
'google/monitoring/v3/common.proto',
'google/monitoring/v3/dropped_labels.proto',
'google/monitoring/v3/group.proto',
'google/monitoring/v3/group_service.proto',
'google/monitoring/v3/metric.proto',
'google/monitoring/v3/metric_service.proto',
'google/monitoring/v3/mutation_record.proto',
'google/monitoring/v3/notification.proto',
'google/monitoring/v3/notification_service.proto',
'google/monitoring/v3/span_context.proto',
'google/monitoring/v3/uptime.proto',
'google/monitoring/v3/uptime_service.proto',
'google/longrunning/operations.proto',
'google/protobuf/any.proto',
'google/protobuf/api.proto',
'google/protobuf/descriptor.proto',
'google/protobuf/duration.proto',
'google/protobuf/empty.proto',
'google/protobuf/field_mask.proto',
'google/protobuf/source_context.proto',
'google/protobuf/struct.proto',
'google/protobuf/timestamp.proto',
'google/protobuf/type.proto',
'google/protobuf/util/json_format.proto',
'google/protobuf/util/json_format_proto3.proto',
'google/protobuf/wrappers.proto',
'google/rpc/code.proto',
'google/rpc/error_details.proto',
'google/rpc/status.proto',
'google/type/calendar_period.proto',
'google/type/color.proto',
'google/type/date.proto',
'google/type/dayofweek.proto',
'google/type/expr.proto',
'google/type/fraction.proto',
'google/type/latlng.proto',
'google/type/money.proto',
'google/type/postal_address.proto',
'google/type/quaternion.proto',
'google/type/timeofday.proto' ] Reading https://github.com/googleapis/googleapis/blob/master/gapic/packaging/common_protos.yaml, it seems the list above is actually fixed by package version of the
I just tested out the above code replacement manually but unfortunately that then gives me a new error:
which unfortunately doesn't give a good stack trace but seems like it would be a dynamic require issue in dynamically requesting a Unfortunately we still haven't made much progress on dynamic require approaches though, and would need to start with a much simpler case to work up to this sort of a problem. So for now, unfortunately, solving this firebase-admin case remains elusive. |
@guybedford I really appreciate the research you just did, thank you very much. I'll have to resort to mongoDB Atlas as serverless db. |
@rauchg That |
I finally managed to find a fix for this in vercel/webpack-asset-relocator-loader#12. |
This includes the updates for correct parser errors, the express templates support, as well as firebase admin support. We have tests for all the above in the asset relocator loader itself, although the firebase-admin case is not a full integration test as that would involve storing credentials. Fixes #317 Fixes #323
@guybedford this error is related to this issue #306 |
If it works with ncc, then this is not the appropriate place for the issue. Please discuss with TooTallNate. |
I am using
is it related to |
@Yuripetusko This error looks like you compiled on Mac and then ran on Linux. Perhaps you should try deploying to Now so that your build environment matches your run-time environment. |
Thanks @styfle |
I still get this error when deploying on now, when using now-cli everything goes ok, but on now i get:
|
The Can you make sure you using the latest |
Hi,
I was using @now/next and got to work by using next@canary dependency
Thanks
… On Aug 19, 2019, at 9:58 AM, Steven ***@***.***> wrote:
Hi @diogoviannaaraujo
The @now/node builder no longer uses ncc.
Can you make sure you using the latest @now/node in your now.json and update the CLI to the latest version by running npm i -g ***@***.***?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
ncc version:
0.16.1
Steps to reproduce
logs of build
we can extract as something interesting is this phrase "but could not be resolved, assuming external".
ncc
does not offer much detail but I feel that these modules are causing the problem in some waythis is curious because that route exists but not in that order
the correct order would be
Users/mark/ncc-bug-firebase/dist/protos/google/api
result of index.js 51861
result of index.js 187679
result of index.js 187764
result of index.js 187802
result of index.js 187929
result of index.js 187933
The text was updated successfully, but these errors were encountered: