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

Comments

Projects
None yet
8 participants
@rpong
Copy link

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()

@lamhieu-vk

This comment has been minimized.

Copy link

commented Nov 29, 2018

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

@s7dhansh

This comment has been minimized.

Copy link

commented Nov 30, 2018

@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

This comment has been minimized.

Copy link

commented Nov 30, 2018

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

Remove meteorhacks:meteorx dependency.
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

This comment has been minimized.

Copy link

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:meteor-apm-agent@3.2.0-rc.0 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.

@lamhieu-vk

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Dec 5, 2018

but no unblock support for new version?

@lamhieu-vk

This comment has been minimized.

Copy link

commented Dec 5, 2018

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

@jorgeer

This comment has been minimized.

Copy link

commented Mar 25, 2019

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",
  ]);
});
@lamhieu-vk

This comment has been minimized.

Copy link

commented Mar 26, 2019

@jorgeer It's very nice!

@tab00

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.