You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when consuming this project with moduleResolution: Node16/NodeNext fail with the following errors:
.../node_modules/micro-memoize/src/Cache.ts(4,10): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.
Add type: module and use .cjs/.mjs extension would fix it.
Unfortunately, this by itself causes a breaking change with how this package is both built and consumed, and I try to adhere to semver as much as possible. I'm working on a v5 that can easily include this change, so I can include it there.
That said, I can piggyback on a simple hack I do for .mjs files that can also be done for cjs. I mention this in the import documentation, but there is a separate micro-memoize/mjs import that is available. I can do the same for CJS, which is not ideal but would likely give you what you need to avoid this error (so long as you use the micro-memoize/cjs) location. If you're willing, I'll spin up a beta of that change that you can test out locally.
I've published 4.2.0-beta.0 with the new micro-memoize/cjs access point, which you should be able to install with just npm install micro-memoize@next. Let me know if this is able to give you what you need for now.
Currently when consuming this project with
moduleResolution: Node16/NodeNext
fail with the following errors:Add
type: module
and use.cjs/.mjs
extension would fix it.i.e.:
type: module
dist/micro-memoize.cjs.js
->dist/micro-memoize.cjs
dist/micro-memoize.mjs.js
->dist/micro-memoize.mjs
The text was updated successfully, but these errors were encountered: