Attempting to incorporate moment.js as an es6 module. The most recent version of Chrome is being utilized.
Referring to the conversation here, I experimented with the src path (es6)
import * as moment from './node_modules/moment/src/moment'
Although omitting the .js appears to function perfectly for everyone in that discussion, I am unable to make it function without it. However, this one does work
import * as moment from './node_modules/moment/src/moment.js'
Nevertheless, the request ultimately fails as every moment import attempts to load its dependencies without the js extension
GET http://127.0.0.1:8083/node_modules/moment/src/lib/utils/hooks net::ERR_ABORTED 404 (Not Found) moment.js:22
GET http://127.0.0.1:8083/node_modules/moment/src/lib/moment/moment net::ERR_ABORTED 404 (Not Found) moment.js:26
GET http://127.0.0.1:8083/node_modules/moment/src/lib/moment/calendar net::ERR_ABORTED 404 (Not Found) moment.js:39
GET http://127.0.0.1:8083/node_modules/moment/src/lib/locale/locale net::ERR_ABORTED 404 (Not Found) moment.js:46
GET http://127.0.0.1:8083/node_modules/moment/src/lib/duration/duration net::ERR_ABORTED 404 (Not Found) moment.js:48
GET http://127.0.0.1:8083/node_modules/moment/src/lib/units/units net::ERR_ABORTED 404 (Not Found) moment.js:50
GET http://127.0.0.1:8083/node_modules/moment/src/lib/utils/is-date net::ERR_ABORTED 404 (Not Found)
My code only consists of a blank index.html with this script tag
<script type="module" src='./main.js'></script>
and a main.js file with this
import * as _ from './node_modules/underscore/underscore.js';
import * as moment from './node_modules/moment/src/moment.js';
The underscore.js imports and functions correctly. The problem lies solely with moment. What am I missing? Additionally, why is it that I can't get either of these to load without specifying the .js extension while it's evident that others on the GitHub thread have managed to do so
import * as moment from 'moment'