-
Notifications
You must be signed in to change notification settings - Fork 0
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
cannot import to esm project #13
Comments
also a few little adjustments for the README +import ApolloServerLogging from 'apollo-server-logging';
import { ApolloServer } from 'apollo-server'
import { schema } from './schema'
import { logger } from './logger'
export const server = new ApolloServer({
schema,
plugins: [
ApolloServerLogging({
// Pass in your application logger here, or leave blank to use the
// default `pino()` logger.
- logger
+ logger,
// All parameters are logged, so use this option to redact certain
// sensitive information from your logs:
- cleanVariableNames: ['password', 'token', 'phone', 'email'],
+ cleanVariableNames: ['password', 'token', 'phone', 'email']
// By default, the above setting's value is `['password', 'token', 'captcha']`
- }),
+ })
]
}) |
I'm able to import this package when the following changes are made. Add the following to apollo-server-logging's package.json exports, "exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
+ "./cjs": "./dist/cjs/index.js",
"./*": {
"types": "./dist/types/*.d.ts",
"import": "./dist/esm/*.js",
"require": "./dist/cjs/*.js"
}
}, Import apollo-server-logging in the following way from the dependent project import { ApolloLoggerPlugin as ApolloServerLogging } from 'apollo-server-logging/cjs'; if you would export the cjs that would help me to use this package. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
import apollo-server-logging into an esm project causes a runtime error (node v19.2.0 here)
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
macos, node v19.2.0
The text was updated successfully, but these errors were encountered: