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

TypeError: Cannot read property 'constructor' of undefined #8

Open
rpong opened this issue Nov 29, 2018 · 10 comments
Open

TypeError: Cannot read property 'constructor' of undefined #8

rpong opened this issue Nov 29, 2018 · 10 comments

Comments

@rpong
Copy link

rpong commented Nov 29, 2018

Since this change has been implemented: meteor/meteor#10053

meteorhacks:meteorx is throwing the following error during build:

TypeError: Cannot read property 'constructor' of undefined
    at exposeSessionCollectionView (packages/meteorhacks_meteorx.js:73:62)
    at exposeLivedata (packages/meteorhacks_meteorx.js:32:5)
    at packages/meteorhacks_meteorx.js:176:1
    at packages/meteorhacks_meteorx.js:201:4
    at packages/meteorhacks_meteorx.js:209:3
    at /xxx/.meteor/local/build/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>)
    at /xxx/.meteor/local/build/programs/server/boot.js:220:19
    at /xxx/.meteor/local/build/programs/server/boot.js:471:5
    at Function.run (/xxx/.meteor/local/build/programs/server/profile.js:510:12)
    at /xxx/.meteor/local/build/programs/server/boot.js:470:11
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

The fix is to change session._namedSubs.[subId]; to session._namedSubs.has(subId); and documentView.documents.[id].constructor; to documentView.documents.has(id).constructor; in /lib/livedata.js for exposeSubscription() and exposeSessionCollectionView()

@lh0x00
Copy link

lh0x00 commented Nov 29, 2018

I fixed at #9
if you want use unblock publications, you can try meteor unblock for new version.

@s7dhansh
Copy link

@arunoda can we kindly get this pr merged and create a new major version?
if not, @lamhieu-vk can you please publish a new package under your name, if you plan to keep contributing.

@macrozone
Copy link

unfortunatly this package here is unmaintained. We should get rid of it as a dependency.

benjamn added a commit to meteor/meteor-apm-agent that referenced this issue Nov 30, 2018
This commit brings the relevant bits of meteorhacks:meteorx into the
mdg:meteor-apm-agent package, so that various issues can be fixed without
forking or continuing to maintain meteorhacks:meteorx.

Related:
meteor/meteor#10337 (comment)
meteorhacks/meteorx#8
meteorhacks/meteorx#9
abecks/meteor-fast-render#25
@benjamn
Copy link

benjamn commented Nov 30, 2018

For those using meteorhacks:meteorx through mdg:meteor-apm-agent, we've just published version 3.2.0-rc.0 of mdg:meteor-apm-agent which no longer depends on meteorhacks:meteorx (though it does borrow some of its tricks, in a way that fixes this problem). To update, just put mdg:[email protected] in the .meteor/packages file in your app(s). As soon as we have some confirmation that this version works, we'll release a final version without the -rc.n suffix.

@lh0x00
Copy link

lh0x00 commented Dec 2, 2018

@macrozone @rpong @benjamn
I have consulted the author and I decided to fork the project and maintain it in the future, it will be an open project for the community and for our company.

You can see details here:
https://github.com/lamhieu-vk/meteorx

@crapthings
Copy link

but no unblock support for new version?

@lh0x00
Copy link

lh0x00 commented Dec 5, 2018

@crapthings
Unblock for Meteor Publications project will maintenance here:
https://github.com/lamhieu-vk/unblock

@fumbleforce
Copy link

For those who are using other packages which have not yet been updated to use lamhieu's new fork, you can make a temporary "proxy" package for meteorhacks:meteorx by making a meteorx folder under /packages, with a package.js containing the content below. This will uninstall the meteorhacks version and install the lamhieu version instead! It worked for me, but of course as the packages that use the old version are not updated, they might not work 100% guaranteed.

Package.describe({
  name: "meteorhacks:meteorx",
  summary: "Proxy for getting another meteorx fork",
  version: "1.4.1"
});

Package.onUse((api) => {
  api.export("MeteorX");
  api.use([
    "lamhieu:meteorx",
  ]);
});

@lh0x00
Copy link

lh0x00 commented Mar 26, 2019

@JorgeER It's very nice!

@tab00
Copy link

tab00 commented Apr 10, 2019

Thanks for the workaround @JorgeER!

I was getting the error because https://github.com/nerdvibe/sikka-CM depends on meteorhacks:meteorx.

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

8 participants