Fails to import in Meteor using Coffeescript? (may be unrelated to simple-schema)
See original GitHub issueI am trying to migrate from the deprecated meteor-simple-schema package to node-simple-schema.
However, in my Meteor 1.5 app I’m facing a very strange issue where SimpleSchema = require 'simpl-schema'
doesn’t work (“SimpleSchema is undefined”) using Coffeescript, while import SimpleSchema from 'simpl-schema';
works fine in a JS file.
This is my Coffeescript code (simplified for testing):
SimpleSchema = require 'simpl-schema'
SimpleSchema.setDefaultMessages
messages:
en:
"too_long": "Too long!"
This throws an SimpleSchema is undefined
error. At first, I was sure I was doing something wrong, but when I tested the following code in plain JS, the undefined error was gone:
import SimpleSchema from 'simpl-schema';
SimpleSchema.setDefaultMessages({
messages: {
en: {
"too_long": "Too long!",
},
},
});
Could this be a SimpleSchema issue? Has anyone successfully imported node-simpl-schema in Meteor using Coffeescript? Thanks!
EDIT: I can hardly imagine this issue is simple-schema related. However, I am importing other NPM packages in my app without any problems and did quite a bit of testing to find the culprit. Still, posting this here feels kinda lame. Sorry for polluting your repo’s issues list and feel free to discard this completely.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
First result when googling your error: could that solve your problem? https://forums.meteor.com/t/solved-meteor-upgrade-to-1-5-error-uncaught-referenceerror-buffer-is-not-defined/36903
since this is totally unrelated to the issue you posted, which is resolved and has nothing to do with simpleschema in the first place, consider closing the issue pls.
Sure thing @persac glad you got it working.