[Solved] Galaxy Deployment Error: TypeError: Cannot read property 'type' of null

I am experiencing this error when attempting to deploy to Galaxy.

Build is working locally on multiple development machines.

2022-06-06 10:05:28-04:00/app/bundle/programs/server/node_modules/fibers/future.js:280n57s0
2022-06-06 10:05:28-04:00 throw(ex);n57s0
2022-06-06 10:05:28-04:00 ^n57s0
2022-06-06 10:05:28-04:00n57s0
2022-06-06 10:05:28-04:00TypeError: Cannot read property 'type' of nulln57s0
2022-06-06 10:05:28-04:00 at packages/aldeed_simple-schema.js:1078:23n57s0
2022-06-06 10:05:28-04:00 at Function._.each._.forEach (packages/underscore.js:147:22)n57s0
2022-06-06 10:05:28-04:00 at adjustArrayFields (packages/aldeed_simple-schema.js:1077:5)n57s0
2022-06-06 10:05:28-04:00 at addImplicitKeys (packages/aldeed_simple-schema.js:1172:3)n57s0
2022-06-06 10:05:28-04:00 at packages/aldeed_simple-schema.js:1190:16n57s0
2022-06-06 10:05:28-04:00 at Array.forEach (<anonymous>)n57s0
2022-06-06 10:05:28-04:00 at Function._.each._.forEach (packages/underscore.js:139:11)n57s0
2022-06-06 10:05:28-04:00 at mergeSchemas (packages/aldeed_simple-schema.js:1183:5)n57s0
2022-06-06 10:05:28-04:00 at new SimpleSchema (packages/aldeed_simple-schema.js:1406:18)n57s0
2022-06-06 10:05:28-04:00 at ns.Collection.c2AttachSchema [as attachSchema] (packages/aldeed_collection2.js:60:10)n57s0
2022-06-06 10:05:28-04:00 at module (imports/api/Suppliers/index.js:99:11)n57s0
2022-06-06 10:05:28-04:00 at fileEvaluate (packages/modules-runtime.js:336:7)n57s0
2022-06-06 10:05:28-04:00 at Module.require (packages/modules-runtime.js:238:14)n57s0
2022-06-06 10:05:28-04:00 at Module.moduleLink [as link] (/app/bundle/programs/server/npm/node_modules/meteor/modules/node_modules/@meteorjs/reify/lib/runtime/index.js:52:22)n57s0
2022-06-06 10:05:28-04:00 at module (server/rest/index.js:1:630)n57s0
2022-06-06 10:05:28-04:00 at fileEvaluate (packages/modules-runtime.js:336:7)

Hi @mvogt22

Which version are you using for:
Meteor
NodeJS
NPM

And what type of machine are you using on Galaxy?
Does it work before, or have you never deployed this app to Galaxy?
Did you update recently your app?

Meteor: 2.7.1
Node: 14.18.2
NPM: 6.14.15

The instance on Galaxy is a Tiny as I am just testing the deployment pipeline, this is a new app.

I have never deployed this app to Galaxy.

are you using Typescript or pure Javascript?

Pure Javascript.

After further investigation it is also failing locally when using the --production flag.

you can check the packages that are under devDependencies, maybe one of them should be on dependencies and that’s why your code is crashing

A recommended method for emulating Galaxy is to run locally with --production . The way node_modules are pulled in is different on a remote deployment to a server (including Galaxy) than when building locally. The --production setting will minimize and concatenate all the JS into one file.
Error Types | Galaxy Docs

Figured out the issue.

It was a weird solution. I moved the Collection2 package higher in the Meteor package file and that fixed the issue.

Glad it worked @mvogt22 :pray:t2:

1 Like