Conversation
@richarddavison , I built commit#c8a60db on my laptop and checked the require calls for the packages I have tried so far and no regressions seem to occur in them. However, in reproduction tests of previously resolved issues, regressions seem to be occurring. NOTE: llrt-clone built commit#c8a60db.
// hello.js
var hello = function world() {
return "hello world"
}
module.exports = hello;// main.js
import hello from './hello.js'
console.log(hello())
// main.js
import hello from './hello.cjs' // The content is exactly the same as hello.js
console.log(hello()) |
|
I have not been able to confirm the assert module that was uncovered this time because it has not been merged into the mainline. If you could rebase it after the merge, I can check it for you. :) |
|
The following error still occurs when importing, but the situation has not changed since before this fix, so it is a different issue. I would like to verify more after this PR is merged... |
I looked at this. Lodash import should now work in this PR |
import { Logger } from '@aws-lambda-powertools/logger';
console.log(Logger);Since the |
Description of changes
CJS imports via ESM now returns the default export if present. This should help with #668 and maintain better consistency with Node.
@nabetti1720 even tho all testes are passing, can you verify this doesn't change expected CJS import behavior from ESM?
Checklist
tests/unitand/or in Rust for my feature if neededmake fixto format JS and apply Clippy auto fixesmake checktypes/directoryBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.