@accounts/magic-link being required even if you're not using it
So happy to see @accounts/magic-link implemented!!!
But I think it seems to be required that you install it even if you're not using it?
I just freshly installed accountsjs and it seems to be looking for it.
can you paste the code you are using so I can have a look?
It also was a required peer dependency for me. Server wouldn't start without it in my package.json even though I have no idea what it is and am not using it.
Sorry for the delay @pradel
node_modules/@accounts/server/lib/types/email-templates-type.d.ts:8:5
8 magicLink: EmailTemplateType;
~~~~~~~~~
'magicLink' is declared here.
at createTSError (/Users/a/Desktop/web-dev/freelance/a/new/backend/node_modules/ts-node/src/index.ts:618:12)
at reportTSError (/Users/anthony/Desktop/web-dev/freelance/a/new/backend/node_modules/ts-node/src/index.ts:622:19)
at getOutput (/Users/a/Desktop/web-dev/freelance/a/new/backend/node_modules/ts-node/src/index.ts:809:36)
at Object.compile (/Users/a/Desktop/web-dev/freelance/a/new/backend/node_modules/ts-node/src/index.ts:1111:30)
at Module.m._compile (/Users/a/Desktop/web-dev/freelance/apaphani/new/backend/node_modules/ts-node/src/index.ts:1224:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions.<computed> [as .ts] (/Users/a/Desktop/web-dev/freelance/a/new/backend/node_modules/ts-node/src/index.ts:1228:12)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
[nodemon] app crashed - waiting for file changes before starting...
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
apollo.ts:42:50 - error TS2345: Argument of type '{ db: Mongo; tokenSecret: string; ambiguousErrorMessages: boolean; tokenConfigs: { accessToken: { expiresIn: string; }; refreshToken: { expiresIn: string; }; }; sendMail: ({ from, subject, to, text, html, }: { from?: string; subject: any; to: any; text: any; html: any; }) => Promise<...>; emailTemplates: { ...; }; s...' is not assignable to parameter of type 'AccountsServerOptions<User>'.
Types of property 'emailTemplates' are incompatible.
Property 'magicLink' is missing in type '{ from: string; resetPassword: { subject: () => string; text: () => string; }; passwordChanged: { subject: () => string; text: () => string; }; verifyEmail: { subject: () => string; text: () => string; }; enrollAccount: { ...; }; }' but required in type 'EmailTemplatesType'.
Once I add an email template for it, It then expects to have the package
Error: Cannot find module '@accounts/magic-link'
Require stack:
@acomito I fix the issue for the types but can you please paste the rest of the stack for this
Error: Cannot find module '@accounts/magic-link'
Require stack:
it will be helpful to debug
It's coming from @accounts/graphql-api
Error: Cannot find module '@accounts/magic-link'
Require stack:
- /project/node_modules/@accounts/graphql-api/lib/modules/accounts-magic-link/index.js
- /project/node_modules/@accounts/graphql-api/lib/modules/accounts/index.js
- /project/node_modules/@accounts/graphql-api/lib/modules/index.js
- /project/node_modules/@accounts/graphql-api/lib/index.js
Seeing the same issue with magic-link being required by @accounts/graphql-api but not included in the dependencies. Adding it alongside graphql-api fixed it but shouldn't need to do that since my package doesn't directly require it.
@zenweasel can we close this issue based on your PR?
@acomito the issue is still there, no pr to fix the issue was opened