FeatureLayer creating in javascript ArcGIS API
'featureCollection' expects a 'features' attribute which is a FeatureSet, and not a featureSet attribute like you are doing:
var featureCollection = {
layerDefinition: {
"geometryType": "esriGeometryPolyline",
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID"
},
{
"name": "text",
"type": "esriFieldTypeString"
},
{
"name": "address",
"type": "esriFieldTypeString"
}
]
},
features:
[
{
"attributes": {
OBJECTID : 1,
text : 'a',
address : 'b',
},
"geometry": { "x": -80.12468662, "y": 40.42756484 }
}
]
};
For future debugging, I suggest copying the ESRI obfuscated code, and making it more readable by using JS Beautifier. Then just search for the error (in my case error was with variable _190). That should help you out with figuring out where and why the error occurs.