Issues with Mithril

Hi everyone ! :grinning:

Two issues, for now, with Meteor :thinking:: 1) Installing spectrum:mithril-meteor in the project works fine, but i think it isn’t updated to 1.1.6 (the actual version of mithril, :anguished: by the way… is there somehow to know what is the library version in the package ? not the package version); 2) Trying to install by npm, after run meteor, shows me this error:

W20180724-21:45:43.987(-3)? (STDERR) /Users/jeffa/.meteor/packages/meteor-tool/.1.7.0_3.w8zcf.uowlh++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20180724-21:45:44.019(-3)? (STDERR) throw(ex);
W20180724-21:45:44.019(-3)? (STDERR) ^
W20180724-21:45:44.019(-3)? (STDERR)
W20180724-21:45:44.019(-3)? (STDERR) ReferenceError: window is not defined
W20180724-21:45:44.020(-3)? (STDERR) at /Volumes/ARQUIVOS/projetos/estudos/meteor/lab/mithril2/node_modules/mithril/mithril.js:387:25
W20180724-21:45:44.020(-3)? (STDERR) at Object. (/Volumes/ARQUIVOS/projetos/estudos/meteor/lab/mithril2/node_modules/mithril/mithril.js:1257:2)
W20180724-21:45:44.020(-3)? (STDERR) at Module._compile (module.js:652:30)

and so on…

Well, well, well :face_with_raised_eyebrow: I really need somehow to install a mithril library updated. If @spectrum read this post, would you update your meteor package ? And if someone knows why the error is happening in npm package, i’m all ears. :wink:

If you check the GitHub repo and look in the mithril.min.js file, you will see that it seems to be a vanilla mithril v0.2.0 file. The Meteor-specific part is reactiveHelper.js. It looks like you would probably be better off just using the mithril npm package directly, rather than an out-of-date atmosphere package.

Not sure I can answer that, but if you have an atmosphere package supplying mithril and an npm package supplying it, you’re probably going to have issues. Otherwise, a fibers error suggests you’ve imported mithril on the server instead of the client.

1 Like

Great :smile: Working… Thanks @robfallows !

1 Like

Yeah, more fans for mithril library :blush:
Combine it with lodash and livescript if you have the chance

1 Like