dcramer / peated

https://peated.com
Apache License 2.0
64 stars 13 forks source link

Migrate to jsx-email #196

Closed dcramer closed 4 months ago

codecov[bot] commented 4 months ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 331 tests with 1 failed, 330 passed and 0 skipped.

View the full list of failed tests ## src/lib/email.test.ts - **Class name:** src/lib/email.test.ts
**Test name:** notifyComment > constructs appropriate email

Error: The locale data for 'person.prefix' aren't applicable to this locale.
If you think this is a bug, please report it at: https://github.com/faker-js/faker
❯ v ../../node_modules/@.../dist/esm/chunk-GTEBSQTL.mjs:1:5252
❯ Object.get ../../node_modules/@.../dist/esm/chunk-GTEBSQTL.mjs:4:205
❯ stringifyObject ../...../hash-it/src/stringify.ts:226:49
❯ stringifyRecursiveAsJson ../...../hash-it/src/stringify.ts:115:42
❯ stringifyComplexType ../...../hash-it/src/stringify.ts:37:12
❯ stringify ../...../hash-it/src/stringify.ts:254:12
❯ stringifyObject ../...../hash-it/src/stringify.ts:226:34
❯ stringifyRecursiveAsJson ../...../hash-it/src/stringify.ts:115:42
❯ stringifyComplexType ../...../hash-it/src/stringify.ts:37:12
❯ stringify ../...../hash-it/src/stringify.ts:254:12
dcramer commented 4 months ago

Was considering if there was some leakage in Vitest, attempting to upgrade that tho to no success right now.

dcramer commented 4 months ago

Just to test a theory I ripped out hoisting and while it exposed a couple of missing deps in the server package, the same issues still arrising here.

dcramer commented 4 months ago

Removing all runtime refs to fixtures (thus faker), and it throws a completely different error.

TypeError: client[procedureType] is not a function
 ❯ ../../node_modules/@trpc/client/dist/createTRPCClient.mjs:21:37
 ❯ Object.apply ../../node_modules/@trpc/server/dist/unstable-core-do-not-import/createProxy.mjs:46:20
 ❯ stringify ../../node_modules/hash-it/src/stringify.ts:262:41
 ❯ stringifyObject ../../node_modules/hash-it/src/stringify.ts:226:34
 ❯ stringifyRecursiveAsJson ../../node_modules/hash-it/src/stringify.ts:146:42
 ❯ stringifyComplexType ../../node_modules/hash-it/src/stringify.ts:96:10
 ❯ stringify ../../node_modules/hash-it/src/stringify.ts:254:12
 ❯ stringifyObject ../../node_modules/hash-it/src/stringify.ts:226:34
 ❯ stringifyRecursiveAsJson ../../node_modules/hash-it/src/stringify.ts:115:42
 ❯ stringifyComplexType ../../node_modules/hash-it/src/stringify.ts:37:12

My intuition tells me that this error is leaking from somewhere else, and likely one being suppressed/caught.

dcramer commented 4 months ago

For some reason Component._self is getting bound and its including the module level namespace (as best I can tell):

https://github.com/shellscape/jsx-email/issues/201#issuecomment-2251259870

dcramer commented 4 months ago

I gave up on trying to make the Tailwind component work, realizing I was wasting too much time on it, and just inlined the styles so we can still swap to a better toolchain.