[Solved] Internal error calling getPublicationStrategy

Hi, we need a reproduction.

Could you share a repo and the steps to get this error?

@filipenevola

I did not do anything to cause this error, all I did was update to version 4.

Note I use ssr using the react-router-ssr package

This is my list of packages :

meteor-base@1.5.1             # Packages every Meteor app needs to have
mobile-experience@1.1.0       # Packages for a great mobile UX
mongo@1.13.0                   # The database Meteor supports right now
reactive-var@1.0.11            # Reactive variable for tracker
standard-minifier-js@2.7.0    # JS minifier run for production mode
es5-shim@4.8.0                # ECMAScript 5 compatibility for older browsers
ecmascript@0.15.3              # Enable ECMAScript2015+ syntax in app code
typescript@4.3.5              # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0            # Server-side component of the `meteor shell` command
static-html@1.3.2             # Define static page content in .html files
react-meteor-data       # React higher-order component for reactively tracking Meteor data
npdev:react-loadable
accounts-base@2.1.0
accounts-password@2.1.0
server-render@0.4.0
communitypackages:picker
gadicohen:sitemaps
hot-module-replacement@0.3.0
alanning:roles
dev-error-overlay@0.1.1
ostrio:files
communitypackages:fast-render
juliancwirko:postcss
mizzao:user-status
communitypackages:react-router-ssr

@filipenevola and @renanccastro , I’ve started to narrow it down. It’s related to accounts, if I’m not logged in and hit refresh nothing happens. If I’m logged in and hit refresh on the browser it throws the error. I’ll setup an repo soon.

1 Like

Thank you, this will be really helpful.

I don’t want to just patch the error avoiding using the server because I want to understand in which flow the server is undefined, I don’t think it should be undefined at this point. Maybe this new error is just highlighting an old problem in the code.

1 Like

Any updates with this issue?

Hi, I’m going to check your reproduction today.

Hi @flean are you sure your reproduction is correct?

Because you mentioned that the problem seems to be related to accounts and your repo has no accounts on it. Your reproduction is using METEOR@2.3.6.

Also, the swiper code was producing errors. So I’m not sure if this is the correct reproduction for this problem.

It’s 2.4 , please select the 2.4 branch.

Hm ok, I also need to run with your settings.

Ok, let me see.

Npm run start and just login then hit reload on the browser and you will get the error on the server

I was able to reproduce the error and when the error happens the Subscription object was not created by Meteor core packages.

I believe there is a package in your app that is creating subscription as well.

I’m still investigating and trying to find other ways to create Subscriptions in Meteor core packages to be sure the problem is not in the core packages.

fast-render context doesn’t contain a server and this context is used to create the Subscription.

I’m thinking about a defensive code to avoid accessing the server property when the fast-render package is present.

Hi @flean and @saeeed this PR in fast-render solves the problem.

@copleykj or @storyteller can release this soon.

Thanks, just tested and it works.

1 Like

I don’t have permission to merge / publish but I see @copleykj already merged this PR (thanks).

So I assume he is going to publish a new version soon!

:slight_smile:

Yea, I downloaded a copy to test in another project and it worked.

1 Like

For the record, how do I find the root of this type of problem?

Usually I get the Meteor core feature and start to add a few logs around it running from my local Meteor checkout.

When I understand where the problem is happening I add a console.trace() to understand who is calling that code.

For example, in this case fast-render is using MeteorX so it’s not that easy to find just reading the code and looking for a specific call. This happens because in MeteorX there are many transformations and assignments along the way mutation the objects but with console.trace() it’s easy to spot where the call is coming from.

You could do the same with debugger but in some cases I prefer to just use the console.

I hope this help in future analysis.

2 Likes

patch for this issue has been published

1 Like