Meteor-Community-Packages / meteor-roles

Authorization package for Meteor, compatible with built-in accounts packages
http://meteor-community-packages.github.io/meteor-roles/
MIT License
921 stars 168 forks source link

UndefinedExportException: Could not import Meteor package - RolesCollection is undefined #412

Closed smetanamolokovich closed 18 hours ago

smetanamolokovich commented 1 day ago

I created a new Meteor + Vue project with the following command:

meteor create --vue simple-todos-vue --release=3.0.2

Then, I added the alanning:roles package and added a Meteor.publish to server/main.js as per the documentation. After importing Roles from meteor/alanning:roles into Home.vue, I encountered an error upon starting the project, which led to a white screen in the browser.

Here is the error message:

Uncaught [meteor-vite] ⚠️ UndefinedExportException: Could not import Meteor package into the client: export 'RolesCollection' is undefined
    at http://localhost:5173/node_modules/.vite/deps/meteor-vite_client.js?v=a01f1f22:117:19
    at Array.forEach (<anonymous>)
    at validateStub (http://localhost:5173/node_modules/.vite/deps/meteor-vite_client.js?v=a01f1f22:109:14)
    at __vite_stub2.js (http://localhost:5173/@id/__x00__meteor/alanning:roles:15:7)
    ...
⚡ Affected package: meteor/alanning:roles
⚡ Export name: { RolesCollection }
⚡ Vite Request ID: meteor/alanning:roles

⚠️ Open an issue - it's likely an issue with meteor-vite rather than 'meteor/alanning:roles'

Steps to Reproduce:

1.  Create a new Meteor + Vue project with meteor create --vue simple-todos-vue --release=3.0.2.
2.  Add alanning:roles package.
3.  Add a Meteor.publish statement in server/main.js as documented.
4.  Import Roles in a Vue component, e.g., Home.vue.
5.  Run the project and open it in the browser.

Environment:

•   Meteor Version: 3.0.2
•   Vue Version: Vue 3 with <script setup>
•   Meteor Packages: alanning:roles
•   Build Tool: Vite (from Meteor + Vue setup)
github-actions[bot] commented 1 day ago

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know