Closed designamx closed 9 months ago
Also been having this issue on Node.js v20.11.0
and v18.14.2
(very recently)
This must be related to the v1.9.0 version just released - you can downgrade to v1.8.1 to avoid this.
Can you provide a standalone example to reproduce the issue though? I'm not sure exactly what would cause this.
@pimterry thanks, that was it
@designamx this is clearly still an issue in the package, but glad to know the downgrade resolves this for you.
Can you please share an example to help reproduce this, or any more information you can about how you're using loglevel? Otherwise this isn't going to be resolved in future releases of the package and so you'll just hit the same issue again later on.
sure, I can do that
I have placed a small docker project, to replicate you just need to docker build -t logleveldebug
. and then docker run logleveldebug
or just yarn
and then yarn start
Please let me know if there is anything else I can help with
Thanks @designamx, that's perfect.
Looks like it's something to do with ts-node-dev's ESM emulation, which treats the exported properties as unmodifiable. That is true for pure ESM modules, but this package isn't actually ESM at all, I think it's just that the runtime is effectively emulating that.
You can fix this failure in the current version by importing with import Logger from 'loglevel'
instead of import * as Logger from 'loglevel'
. That will avoid this bug but otherwise behave exactly the same.
That said, I think I know what's caused the underlying issue in this case, so it should be easy enough to fix properly so everything works in the previous syntax too. I'll dig into that and release a fully fixed update shortly.
Now fixed in v1.9.1.
I've tested in the above repo and using the latest package version everything once again works correctly with no changes required to imports or anything else.
I'm going to close this now as resolved, but please shout if anybody is still seeing this issue elsewhere.
starting today we are getting this error
Node:
node:20.6.1-alpine3.17
also testednode:20.10.0-alpine3.17