26

Bloody hell I have been stuck for two hours on a problem and couldn't find any solutions. So naturally I asked my Senior for help. I was trying to export a js file like :

---------config.js--------
module.export = function (app){
//code here
}

-----------Index.js------------
var config = require('./config.js')

config(app)

but it would throw an error saying config is not a function. Wasted two hours only for my senior to point out that I missed an "s" in module.export 😑

Feels so stupid. bloody ass.

Comments
  • 6
    Well next time this happens you'll know what to do. I've suffered from this type of bugs when starting out in web dev, but now if browser doesn't point it out, I easily know where to look and fix
  • 1
    Use config,
    npm install --save config
  • 0
    Are you british
  • 0
  • 0
    @MacDev that's real struggle. And if you do webpack for heroku the path to it needs to go to assets/JavaScripts I mean bundle .
  • 1
    @freshlyfe I have to take a look at webpack, I have been working with gulp and it's way too slow. But I'll be forced to use gulp since the project we are working on uses gulp. But my seniors have promised to use webpack on the next project. :)
Add Comment