Simple-todos step 8. doesn't work[SOLVED]

After installing meteor add accounts-ui accounts-password and completing the step 8. my app doesn’t work. In browser windows it displays blue background but nothing from tasks or user input field does’t shows up. In console I get this errors.

Uncaught Error: Cannot find package “account-base”. Try “meteor add account-base”.


at fallback (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:609)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:254)
at Module.moduleLink [as link] (modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:313)
at accounts-config.js (accounts-config.js:1)
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
at Module.moduleLink [as link] (modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:313)
at main.js (main.js:1)
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)

Any thoughts how can I solve this?

Edit: forget this answer. Read @storyteller’s post

Can you try to simple issue the command its asking for? :stuck_out_tongue:

meteor add account-base

Strange, seems like there is a typo somewhere as it should be accounts-base instead of account-base (plural account instead of singular).

1 Like

Omg I did not notice that!

1 Like

Hi, thank you very much for answearing my question, but that’s not the case.

I’ve checked my accounts-config file and there is import { Accounts } from 'meteor/accounts-base'; which is in imports\startup.

Then, in main.js in client folder is import '../imports/startup/accounts-config.js';

When I write in cmd (with administrator premissions) meteor add accounts-ui accounts-password it gives me back this:

accounts-ui without a version constraint has already been added.
accounts-password without a version constraint has already been added.

I’ve tried to remove node_modules from my app folder and install it back again but no results.

And now the error is new

Uncaught Error: Target container is not a DOM element.
at invariant (modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:3619)
at legacyRenderSubtreeIntoContainer (modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:23454)
at render (modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:23535)
at Meteor.startup (main.js:9)
at maybeReady (meteor.js?hash=33066830ab46d87e2b249d2780805545e40ce9ba:927)
at HTMLDocument.loadingCompleted (meteor.js?hash=33066830ab46d87e2b249d2780805545e40ce9ba:939)
invariant @ modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:3619
legacyRenderSubtreeIntoContainer @ modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:23454
render @ modules.js?hash=e336cd2b168caf1faf92630f2209c6fffc958cf3:23535
Meteor.startup @ main.js:9
maybeReady @ meteor.js?hash=33066830ab46d87e2b249d2780805545e40ce9ba:927
loadingCompleted @ meteor.js?hash=33066830ab46d87e2b249d2780805545e40ce9ba:939

which points to Meteor.startup @ main.js: 9 and there is render(<App />, document.getElementById('render-target'));

Just to clarify. You are using React completely?
Check where you have render-target and make sure that it is an empty div.

Load this file on the server. That might be the reason :stuck_out_tongue:

Yes, I do. May you clearyfied it a little bit, how to make it as a empty div?

Tried that also, but then gives back:

Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.
Errors prevented startup:

While running post-startup callbacks:
error: write EPIPE

Your application has errors. Waiting for file change.

I’ve tried to install --save bcrypt but no resaults too.

How does your main.html look?

You don’t have to worry about this bcrypt warning at this stage. It is not relevant to the original issue.

Heeeeey guys,

I’ve found solution on Stack Owerflow. The problem was missing line from main.js in client folder import './main.html';

After inserting this everything works perfect.

So my main.js file looks like:

import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';

import './main.html';

import '../imports/startup/accounts-config.js';
import App from '../imports/ui/App.js';

Meteor.startup(() => {
    render(<App />, document.getElementById('render-target'));

Link where I’ve found solution is here

Thank you veeery much. Wishing you the best in the New Year

That is strange. I don’t import my main.html in my main.js. But then I have this function there to make sure that there is always a div to insert React into:

function getRootNode(rootId) {
  const rootNode = document.getElementById(rootId);

  if (rootNode) return rootNode;

  const rootNodeHtml = `<div id="${rootId}"></div>`;
  const body = document.getElementsByTagName('body')[0];
  body.insertAdjacentHTML('beforeend', rootNodeHtml);

  return document.getElementById(rootId);
1 Like