meteor / meteor/validated-method

Bug in package tests: ReferenceError SimpleSchema is not defined

Open
#48 12 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
193
Forks
29
PR merge metrics
No merged PRs in 30d

Description

```
ReferenceError: SimpleSchema is not defined
at Package (validated-method-tests.js:3:17)
at C:\Tech\escalade\profile-meteor\.meteor\local\build\programs\server\packages\mdg_validated-method.js:366:4
at C:\Tech\escalade\profile-meteor\.meteor\local\build\programs\server\packages\mdg_validated-method.js:375:3
at C:\Tech\escalade\profile-meteor\.meteor\local\build\programs\server\boot.js:242:10
at Array.forEach (native)
```

Environment:
Meteor 1.2.1
validated-method 1.1.0
simple-schema 1.5.3 (as an explicit dependency of the project)

Steps:
1. Take an old project, and install validated-method
2. Convert a vanilla Meteor Method to a validated-method
3. Run the project

I have SimpleSchema being used for validation in all the Template js files, so it is generally available to app code. This is Meteor 1.2.x, so all the code is eager-loaded and available everywhere. I'm guessing this has something to do with the fact that the error is from a package, so presumably the load order means that validated-method is getting loaded before simple-schema is available.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with validated-method-tests.js at the failing Package entry point and inspect how simple-schema is declared and loaded for package tests. Reproduce the failure with Meteor 1.2.1, validated-method 1.1.0, and simple-schema 1.5.3; done means the package starts without the ReferenceError and its tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.