Esm: Can't import folder/index.mjs with `import './folder'`

Created on 19 Aug 2017  路  3Comments  路  Source: standard-things/esm

You can const module = require('./folder') when the folder has an index.js but import module from './folder'; produces this error:

Error [ERR_MISSING_MODULE]: Cannot find module ../function
    at /private/tmp/test-esm/main.mjs
    at Object.<anonymous> (/private/tmp/test-esm/main.mjs)
    at Module._compile (module.js:573:30)

Reproducible testcase

Is this intended?

bug

Most helpful comment

All 3 comments

Can't wait to upgrade from 0.2.2. 馃

Fixed by v0.6.0. Please note I've changed some usage instructions.

Was this page helpful?
0 / 5 - 0 ratings