Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 9 of serialize-error is not compatible with this library #9

Closed
nponiros opened this issue Nov 27, 2021 · 2 comments
Closed
Labels

Comments

@nponiros
Copy link

serialize-error version 9 uses "type": "module" in its package.json but this library uses (after it is compiled) require to load that module. This returns the following error.

.../node_modules/slonik-interceptor-query-logging/node_modules/serialize-error/index.js:1
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/slonik-interceptor-query-logging/node_modules/serialize-error/index.js
require() of ES modules is not supported.
require() of .../node_modules/slonik-interceptor-query-logging/node_modules/serialize-error/index.js from .../node_modules/slonik-interceptor-query-logging/dist/src/factories/createQueryLoggingInterceptor.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from .../node_modules/slonik-interceptor-query-logging/node_modules/serialize-error/package.json.

    at new NodeError (internal/errors.js:322:7)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1102:13) {
  code: 'ERR_REQUIRE_ESM'
}

I guess the simplest fix would be to use version 8.1.0 of serialize-error instead of version 9.0.0. See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@gajus gajus closed this as completed in bae7642 Nov 28, 2021
@gajus
Copy link
Owner

gajus commented Nov 28, 2021

🎉 This issue has been resolved in version 1.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Nov 28, 2021
@nponiros
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants