Moment library fails on back end - no diagnostics

I am trying to use the moment library. It’s installed as a node module so that I can access it from my web module. Here is the client code:

export function button2_click(event) {
console.log(“About to test moment”);
testMoment().then( str => console.log("Result: " + str));
}

Here is the web module code:

import {moment} from ‘moment’;

export function testMoment() {
console.log(“Inside testMoment()”);
return new Promise( function(resolve, reject) {
try {
// resolve(“This is a test”);
resolve(moment().format(“dddd MMM D YY”));
} catch(err) {
reject(err.toString());
}
});
}

This is what I get in the console:
About to test moment
Inside testMoment()

That’s it. I would expect to see a third line containing the formatted date.
When I move the comment down so that “This is a test” resolves and the moment() is not used, I get this:

About to test moment
Result: This is a test
Inside testMoment()

So, it works as long as I’m not using the moment library. The call to moment().format() is killing the thread on the back end but I have no visibility into what’s happening. Is there anything I can do to see what happened on the server? I’m using the sandbox database, not live. Of course an actual resolution to this problem would be great but I’d settle for some visibility into the error that’s presumably showing up in the server log so I can figure it out for myself.

I use the following web module code for moment:

export function parseDates (datetime,format) {
var moment = require (‘moment’);
return moment(datetime).format(format);
}

The difference I see is that I use require rather than import… Yes, require gives a syntax error, but it still works.

Works for me - thanks! Problem in the transpiler? Like who would have thunk?