My app ran fine with 1.6.0.1, but after upgrading to 1.6.1 I’m getting this error on Windows 10:
W20180201-21:37:43.535(-8)? (STDERR) c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\app\app.js:1542
W20180201-21:37:43.537(-8)? (STDERR) let exports = module.exports = {};
W20180201-21:37:43.538(-8)? (STDERR) ^
W20180201-21:37:43.539(-8)? (STDERR)
W20180201-21:37:43.539(-8)? (STDERR) SyntaxError: Identifier 'exports' has already been declared
W20180201-21:37:43.540(-8)? (STDERR) at createScript (vm.js:80:10)
W20180201-21:37:43.540(-8)? (STDERR) at Object.runInThisContext (vm.js:139:10)
W20180201-21:37:43.541(-8)? (STDERR) at c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\boot.js:393:30
W20180201-21:37:43.541(-8)? (STDERR) at Array.forEach (<anonymous>)
W20180201-21:37:43.542(-8)? (STDERR) at c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\boot.js:220:19
W20180201-21:37:43.542(-8)? (STDERR) at c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\boot.js:471:5
W20180201-21:37:43.543(-8)? (STDERR) at Function.run (c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\profile.js:510:12)
W20180201-21:37:43.544(-8)? (STDERR) at c:\Users\Ron\WraithNotes\Meteor\WraithNotes\.meteor\local\build\programs\server\boot.js:470:11
The line let exports = module.exports = {}; does appear in multiple server-side JS files, but this has always compilied fine. Is this a problem with 1.6.1 or is my code bad? A redacted sample file follows:
import { Meteor } from "meteor/meteor";
require('../lib/schemas.js');
const helpers = require('./serverHelpers.js');
let exports = module.exports = {};
let keydata = {};
let smsdata = {};
let smudata = {};
let uber = {};
// *********************************************************************** //
// *********************************************************************** //
function initUber(accountId) {
/* ... REDACTED ... */
}
// *********************************************************************** //
// *********************************************************************** //
exports.getUberAuthorizeUrl = function(accountId) {
/* ... REDACTED ... */
}
// *********************************************************************** //
// *********************************************************************** //
function handleCallback(params, request, response, next) {
/* ... REDACTED ... */
}
The REDACTED function bodies have no affect on the error.