I am trying to add roles to a pretty much base level app (after following the React tutorial for Tasks list). My main.js is below, and you can see it is all pretty straightforward, but I get a boot error when trying to run, and TS is giving the error - Module ‘“meteor/roles”’ has no exported member ‘Roles’
import { Meteor } from "meteor/meteor";
import { Accounts } from "meteor/accounts-base";
import { Roles } from "meteor/roles";
import { RatingsCollection } from "../imports/api/Ratings/RatingsColl";
import "../imports/api/Ratings/RatingsPubs";
import "../imports/api/Ratings/RatingsMethods";
const insertRating = (ratingText) => RatingsCollection.insertAsync({ rating: ratingText });
Meteor.startup(async () => {
await Roles.createRoleAsync('admin');
await Roles.createRoleAsync('Teacher');
await Roles.createRoleAsync('Student');
await Roles.createRoleAsync('Parent');
const { users } = Meteor.settings;
for (const { username, password, roles } of users) {
const userExists = await Accounts.findUserByUsername(username);
if (!userExists) {
const userId = await Accounts.createUser({ username, password });
await Roles.addUsersToRoles(userId, roles);
}
}
if ((await RatingsCollection.find().countAsync()) === 0) {
[
"1",
"2",
"3",
"4",
"5",
].forEach(insertRating);
}
});