Throw errors "Cannot find module 'customWidget/CustomWidget'" when installed widget only contains .mjs file
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
**Bug**
Package Version: v6.0
1. Create an app project and a widget project, both modern(.mjs)
2. Build widget project to generate `.mjs` output
3. Run `npm run build` form app project, success
4. But, when run `npm run test`, throw errors
```text
Error: Cannot find module 'customWidget/CustomWidget'
at Function.Module._resolveFilename
at Function.Module._load
at Module.require
at require
at
at
at Object.
at Module._compile
at Module.m._compile
at Module._extensions..js
```
The cli-test-intern **NOT** found the `.mjs` file, but the file exists.
Then I try build the widget with `--legacy`, put the `.js` file to the node_modules/customWidget/,
And run `npm run test` again, tests all passed.
So I think cli-test-intern may not found `.mjs` correctly.
Contributor guide
Assessment
This issue has not been assessed yet.