Using Mongoose with IntelliJ IDEA Causes Unresolved Function or Method - node.js

I just downloaded the 30-day trial of IntelliJ IDEA Ultimate Edition and I'm having an issue with the Node.js project I imported.
I am using Mongoose and am using the find and findById methods of my model classes fairly often. Since these methods are provided by mongoose and not actually defined explicitly in my model classes, IntelliJ does not seem to like them. Everywhere that I use the methods, I get an error saying "Unresolved function or method xxx".
I have read several other users stating they had similar issues with Node and WebStorm, but those all seemed to be with the code Node library and all of the answers said to use the Node.js Globals library. I have imported this library and tried downloading both mongodb-DefinitelyTyped and mongoose-DefinitelyTyped from the Libraries screen, and still cannot get the warnings to go away.

I decided it was probably faster to contact JetBrains support since I didn't seem to be getting any quick solutions here. I guess this issue is a bug with IntelliJ IDEA 14 because they had me try the IntelliJ IDEA 15 EAP and it worked fine.
So I guess the solution is to go EAP or just wait for 15 if anybody else has this issue.

Related

unresolved reference: fillMaxSize() and unresolved reference: size() error in android studio with Kotlin

I started very basic android development and from the very first day it seems that android studio and kotlin are just like a bundle of problems. Like after first installation of androidstudio I build the basic samples on Kotlin and it worked fine. After few hours I got a notification on androidstudio about some update so I did it and then every thing stopped working I looked for solution on Internet and tried for 2-3 hours but didn't get it back working. Then I uninstalled everything related to androidstudio on my PC and re-installed it and then it started to work again.
After few days I started to implement a tutorial and I used the same code and configuration described in tutorial but on the very first step where they just created a basic sample application without any thing and it started to show errors like Unresolved reference: fillMaxSize and Unresolved reference: size and I couldn't find any solid solution on Internet and surprisingly found out that internet is full of these kind of issues on androidstudio.
In the project I am using the function fillMaxSize() in another file where it works 100% fine but in the same project but in different file it gives error. Can anybody give a solution to this?
Apart from this I just want to ask that is android development in general is like this? That every time you go 1 line further and you see new errors and then you have to spend hours on internet and look for solutions and you then found tons of queries about these errors on internet and nothing is clear and particularly working for your case but it is kind of similar error_
Adding new imports, changing plugin versions, adding plugins, changing dependencies and versions.
After few hours I got a notification on androidstudio about some update so I did it and then every thing stopped working
Updates of course are good as they try to fix or enhance something. However, some updates will add, remove or change some previous working functions to achieve the fixing or enhancing purpose. And that's why some programs require certain version of Software instead of always the latest one to run.
In the project I am using the function fillMaxSize() in another file where it works 100% fine but in the same project but in different file it gives error
In this case, you will have to check whether you have really added the corresponding import to that particular file. If there is really configuration problem, it should not have worked in one file but not the other. import is something that you have to do in every file using that function.

ReferenceError: Promise is not defined OnsenUI

So i just installed monaca by following this doc from onsen website. But when i do the second step i always get this error:
[ReferenceError: Promise is not defined]
Tried everything on the internet but it seems like all the question is not relevant to onsen ui. So i decided to ask.
You are correct - the problem doesn't seem to come from Onsen UI.
Most likely during the monaca create command the code is trying to use native promises, but wasn't able to find them.
Make sure that you have node version which is at least 0.12 and you should be fine.

How can I use AutoMapper with my Xamarin.iOS project?

It seems that when I reference AutoMapper v3.1.0 in my Xamarin.iOS project, the build fails with this error message:
Error MT2002: Failed to resolve "System.Linq.Expressions.Expression System.Linq.Expressions.ExpressionVisitor::Visit(System.Linq.Expressions.Expression)" reference from "System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" (MT2002)
When I roll back to the revision before I added this, it all works fine.
Unfortunately, I've already done quite a bit of work with AutoMapper in my unit tests and it would be problematic to remove it now. I guess that's a lesson to learn: just because it works in a test doesn't mean it works in Xamarin.iOS.
I would be very grateful if anyone has any ideas.
Edit: I have now discovered a MonoTouch directory in the AutoMapper package, but referencing the AutoMapper.dll and AutoMapper.iOS.dlls found within does not solve the problem.
Edit #2: This issue only occurs when building for the device - I guess the MSIL to native converter doesn't like AutoMapper for some reason. I'm trying to find a way to "hint" to this compiler that we need these symbols, which is what I think the purpose of the LinkerPleaseInclude.cs file is.
This issue is temporarily resolved - I had to hack out the offending symbols in AutoMapper and recompile it. Please see automapper issue #429 for more information on what symbols I removed. Until AutoMapper is updated to fix this problem, that's how you have to solve it for now.
The reason for this is explained concisely in another StackOverflow question - basically there are subtle differences between the .NET and Mono frameworks that in this case are incompatible with AutoMapper.
This answer previously stated that you should turn off linking to work with AutoMapper. While you can do this for development, it's not suitable for production use as it will yield a massive binary and you will not be able to submit your app to the app store.

IntelliJ Idea 12 Unable To Resolve Express Methods

For some odd reason, I can't seem to have code completion with the "express" object in my node.js project. Here is a screen of it.
My OS is Windows 8 and I am using IntelliJ Idea 12.11. Perhaps I need to do some extra setup? Please let me know.
#CrazyCoder got it right, it is indeed a intellij bug, as of now still unpatched, guess we have to wait =( The URL is http://youtrack.jetbrains.com/issue/WEB-6667. In the meantime, I guess I will have to live with it.
if you are on IDEA 13, you will still not get the Express methods until you use the express typescript stub
go to Javascript Libraries > Downloads and switch the combobox at the top to Typescript community stubs then type express
you should see the stub, it's also here:
https://github.com/borisyankov/DefinitelyTyped/blob/master/express/express.d.ts
if you are on Java 1.7 and haven't disabled the SNI Support you will get a handshake alert and the download will fail, go to the directory where your IDEA.exe is located and add the following line to the idea.exe.vmoptions:
-Djsse.enableSNIExtension=false

Intellisense, auto completion with RequireJS in visual studio 2012

I know javascript intellisense support trough _referencs.js in vs2012.
At this moment, I am using RequireJS in my frontend, but I think I lost auto-completion supporting in javascript since I started using RequireJS.
I found require.intellisense.js from here, but, unfortunatelly failed with it after several hours and tries.
Is there anyone succeeded in getting auto-completion with RequireJS(version 2.1.2) in vs2012?
I got Intellisense to work inside RequireJS defined modules by following this Code Project article: http://www.codeproject.com/Articles/460836/Making-the-most-out-of-JavaScript-Intellisense-in
The download code is at this link: https://github.com/chrisprice/PropertyFinder-HTML5/zipball/master
The solution that has the working Intellisense is the iPhone solution.
You'll want to download the code referenced in the article and try it out. Between the download code and that article, you should be able to take it from there to implement Intellisense in your own project.
There is a require.intellisense.js file in the source code for the article that is critical to proper operation. I'm not sure who wrote it, but it is different than the one you reference from jrburke.
If you have any follow up questions, I'll be happy to help.

Resources