Why are routing and useraccount packages so hard?

Used Meteor a bunch in the past when Iron Router was the goto and before FlowRouter started to come up.

I followed the new docs on a clean Blaze project and all the dependencies to use a simple Bootstrap 5, SCSS, accounts-password template and there is nothing but errors when trying to install FlowRouter and the UserAccounts packages for unstyled and flow routing.

UserAccounts Core seem to even have failing builds on the GitHub and nothing seems to be updated in the last few years so curious is it even worth starting a new project with Meteor still?

Hi @nonstopdev to answer your opinion, of course it is worth it. I wouldn’t say I’d do Blaze for large or important projects but I’d definitely go that way for something small web and mobile. I am a React builder and can’t have more satisfaction with the Meteor ecosystem.

Now, to answer your technical aspect, can you share some of the errors you get pls. SCSS can be a bit** and there are ways to deal with that but I see your problem is with Meteor packages.
What do you mean by “UserAccounts Core”. meteor packages are names like “accounts-base”, “accounts-ui-unstyled” etc. There are Meteor packages that are not dependent on other libraries and they don’t need to be touched for years. Similarly, in the NPM ecosystem most of the packages get updates for their dependencies and not to their own code.

Two questions please:

3 Likes

Hi there.

Yes, this was a fresh project from the meteor create --blaze which provided 2.7.3

I digged more and more and it seems like going step by step through the docs, the useraccounts:flow-routing package seems to be breaking everything.

If you are adding it with useraccounts:unstyled you get this error:
error: Potentially incompatible change required to top-level dependency: useraccounts:unstyled 1.13.1, was 1.14.2.

If you remove unstyled, and try to add it on its own, you get this error:

 => Errors while adding packages:             
                                              
While loading package kadira:flow-router@2.11.0:
error: Command failed: /Users/developer/.meteor/packages/meteor-tool/.2.7.3.1ee5v5q.1jink++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm rebuild --update-binary
evalmachine.<anonymous>:40
} = primordials;
^

ReferenceError: primordials is not defined
at evalmachine.<anonymous>:40:5
at Object.<anonymous> (/Users/developer/.meteor/packages/kadira_flow-router/.2.11.0.1bg127s.xd8q++os+web.browser+web.cordova/npm/node_modules/fs-extra/node_modules/graceful-fs/fs.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/Users/developer/.meteor/packages/kadira_flow-router/.2.11.0.1bg127s.xd8q++os+web.browser+web.cordova/npm/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:3:27)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs@1.9.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@1.9.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/developer/.npm/_logs/2022-07-15T16_10_30_050Z-debug.log
evalmachine.<anonymous>:40
} = primordials;
^

ReferenceError: primordials is not defined
at evalmachine.<anonymous>:40:5
at Object.<anonymous> (/Users/developer/.meteor/packages/kadira_flow-router/.2.11.0.1bg127s.xd8q++os+web.browser+web.cordova/npm/node_modules/fs-extra/node_modules/graceful-fs/fs.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/Users/developer/.meteor/packages/kadira_flow-router/.2.11.0.1bg127s.xd8q++os+web.browser+web.cordova/npm/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:3:27)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs@1.9.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@1.9.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/developer/.npm/_logs/2022-07-15T16_10_30_050Z-debug.log

This is a new app, latest meteor, trying to follow the documents to build a working user system with routing… Pretty basic before things start breaking and concerning.

1 Like

Just a side-note useraccounts name space is not official. Those were third party packages and sadly the developers have left them without handing their management over to anyone.

Ah damn. I was under the impression the core packages like useraccounts took a similar path as flow router to help keep them updated by MDG.

useraccounts are not core packages. Accounts packages like accounts-password without any namespace are core packages and they are being kept up to date.

1 Like

I guess the official documents and guides word it a bit more like it has some type of integration and support as Meteor releases updates to keep it in sync since this functionality is a core part of most web apps and really kinda jumps from Accounts UI which has a set of buttons to just build auth and then the other end of the scale of “Roll your own login system using core Meteor”.

Once you’ve gotten your initial prototype up and running with accounts-ui , you’ll want to move to something more powerful and configurable so that you can better integrate your login flow with the rest of your app. The useraccounts family of packages is the most powerful set of accounts management UI controls available for Meteor today. If you need even more customization, you can also roll your own system, but it’s worth trying useraccounts first.

Good catch! That needs to be fixed, that is giving a bad impression.

If you want some example projects using flow router with Blaze please checkout lea.online developers · GitHub