vazco / universe-modules

Use ES6 / ES2015 modules in Meteor with SystemJS
https://atmospherejs.com/universe/modules
MIT License
52 stars 7 forks source link

unable to find '<...>/main.import.js(x)' #38

Closed dingfengquek closed 4 years ago

dingfengquek commented 8 years ago

Unable to find the module when the filename is main.import.js or main.import.jsx.

I'm not sure whether this is replicable in other environments; If it's an issue, it's a minor inconvenience only: documenting it down would solve it (if the code is hard to change).

Please close if it can't be replicated.

MacRusher commented 8 years ago

How are you loading the module? Inside other .import.js(x) file or from normal js file using System.import('/main')? In the second case usual Meteor file loading order is still important, and main files are loaded at the end, so the module may not be ready at the time you are requesting it. The same way you cannot System.import('/z') inside a.js. We take care of this inside modules so you can do import z from './z' inside a.import.js, but for other cases Meteor normal rules are still in play.

dingfengquek commented 8 years ago

I'm doing this inside a .import.js(x) file, on the client.

For e.g., I just tried it again with

When I run the app on the client, I get this error:

Uncaught (in promise) [Universe Modules]: Trying to load module "/client/main" that doesn't exist! Error loading /modules/app/client/main as "/client/main" from /modules/app/zzz-module-entrypoint/inside

MacRusher commented 8 years ago

I'm not able to reproduce it right now. As a temporary workaround please don't use main as a module name to be imported. I'll look into it after the holidays.

dingfengquek commented 8 years ago

Noted. I'll upload a Meteor project tarball where I can consistently produce this error, after the holidays as well.

MacRusher commented 8 years ago

That would be great, thanks! 26 gru 2015 14:13 "Dingfeng Quek" notifications@github.com napisał(a):

Noted. I'll upload a Meteor project tarball where I can consistently produce this error, after the holidays as well.

— Reply to this email directly or view it on GitHub https://github.com/vazco/universe-modules/issues/38#issuecomment-167323363 .

dingfengquek commented 8 years ago

universe-modules-bug.tar.gz

EDIT: Added .meteor directory to the tar (excludes .meteor/local)

dingfengquek commented 8 years ago

hey, since Meteor 1.3 would have modules, i don't think this issue would be much relevant in the long-term, nor is it that important to verify whether this the coding error leading to this issue will lead to other more critical problems.

immediate needs: anyone who encounters this can just use another filename, until 1.3 is stable.

thanks though!

radekmie commented 4 years ago

We've decided to archive some of our repositories as we are no longer using nor willing to maintain them. Part of this process involves closing related issues and PRs. If you still need help, do contact us on opensource@vazco.eu.