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

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

Closed
smetanamolokovich opened this issue Nov 12, 2024 · 1 comment

Comments

@smetanamolokovich
Copy link

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)
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant