title: AWS Lambda module initialization error
body: <p>I have recently started Lambda function development on AWS. When try to import a JavaScript file I am getting the following error,</p>
  
  <pre><code>module initialization error: ReferenceError
  at Object.&lt;anonymous&gt; (/var/task/model/claim_type.js:3:29)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.require (module.js:497:17)
  at require (internal/module.js:20:19)
  at Object.&lt;anonymous&gt; (/var/task/index.js:2:19)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.require (module.js:497:17)
  at require (internal/module.js:20:19)
  </code></pre>
  
  <p>In root level I have the <em>index.js</em> file and <em>claim_type.js</em> file inside the <em>model</em> directory.</p>
  
  <p>index.js</p>
  
  <pre><code>const Sequelize = require('sequelize');
  const ClaimType = require('./model/claim_type.js');
  
  exports.handler = function (event, context, callback) {
      //function content
  }
  </code></pre>
  
  <p>claim_type.js</p>
  
  <pre><code>const Sequelize = require('sequelize');
  
  const ClaimType = sequelize.define('claimtype', {
      id: {
          type: Sequelize.INTEGER,
          autoIncrement: true,
          primaryKey: true
      },
      name: {
          type: Sequelize.STRING
      }
  }, {
          timestamps: false
      });
  
  module.exports = ClaimType;
  </code></pre>
  
  <p>What is the correct way to import the <em>claim_type.js</em>?</p>