Skip to content
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

npm simple-schema errors in production v1.10 #4173

Closed
willmoss1000 opened this Issue Apr 12, 2018 · 5 comments

Comments

5 participants
@willmoss1000
Copy link
Contributor

commented Apr 12, 2018

Issue Description

The following errors were encountered when running in production:
Error: "settings.cart.cleanupDurationDays" is in the schema but "settings.cart" is not
Error: "settings.public.segmentio.enabled" is in the schema but "settings.public.segmentio" is not
Other similar errors show once these are fixed.

Steps to Reproduce

Not sure how to reproduce locally. I was running a custom production image which was dockerized. However, the issue and cause are clear. These lines of code are only accessed in production, and so weren't found during the transition to npm simple-scheme.

Possible Solution

Add

  "settings.cart": {
    type: Object,
    optional: true,
    defaultValue: {}
  }

or similar to the relevant schemes.

Note

I'm finding and fixes all instances and will create a pull request upon completion.

Versions

Node: 8.9.0
NPM: 5.7.1
Meteor Node: 8.9.4
Meteor NPM: 5.6.0
Reaction CLI: 0.29.0
Reaction: 1.10.0
Reaction branch: shipping-by-weight
Docker: 18.03.0-ce

@zenweasel

This comment has been minimized.

Copy link
Member

commented Apr 12, 2018

@willmoss1000 When you make a PR you could probably just remove that analytics.js as I believe it's not used any longer.

@loanlaux

This comment has been minimized.

Copy link

commented Apr 12, 2018

Having this issue as well. After fixing the missing schema fields causing Reaction not to start up, all I'm getting on the client side is a blank page and the following error in the console: Uncaught Error: "settings.shops.enabledShopTypes" is in the schema but "settings.shops" is not.

@aldeed

This comment has been minimized.

Copy link
Member

commented Apr 12, 2018

This is due to npm installing and getting 1.4.3 of simpl-schema package, which made these silent errors louder. The quick fix is to pin "simpl-schema": "1.4.2" in package.json and then reinstall.

These are actual schema errors, though so someone should also do a PR to bump to 1.4.3 (pinned) and fix all of the schemas

@srikanthkolli

This comment has been minimized.

Copy link

commented Apr 13, 2018

Errors keeps on popping even after updating registry.js and analytics.js. Simplest solution is to restrict the simpl-schema to 1.4.2 in package.json

@willmoss1000

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2018

Ok, I'm pinning to 1.4.2 for now. Sorry, I don't have time to find all these right now as we are launching Monday. The errors I've found so far are:
registry.js:

  "settings.cart": {
    type: Object,
    optional: true,
    defaultValue: {}
  }

analytics.js:

  "settings.public.segmentio": {
    type: Object,
    optional: true,
    defaultValue: {}
  },
  "settings.public.googleAnalytics": {
    type: Object,
    optional: true,
    defaultValue: {}
  },
  "settings.public.mixpanel": {
    type: Object,
    optional: true,
    defaultValue: {}
  },
  "settings.public": {
    type: Object,
    optional: true,
    defaultValue: {}
  }

marketplace.js:

  "settings.shops": {
    type: Object,
    optional: true,
    defaultValue: {}
  },

This could well be all of them, but likely isn't. If I do find the time this evening I'll post here, and submit a pull requests if they are all found.

Note: as @zenweasel suggested above. Remove Analytics.js when the request is submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.