Closed tom3rr closed 5 months ago
@tom3rr confirmed that your reproduction has the issue. looking into it...
Alright this is almost certainly related to this change: https://github.com/shellscape/jsx-email/commit/e0a7eb44a96b85fed54d918bd3a05b788606267d#diff-956e216fa7df03ccf64dcfcbe8fdacf5560897b6726255ff29c1c3c8cc757721R124 and the way that pnpm, yarn, and npm differ in how they create binaries in node_modules/.bin
I was able to reproduce this locally with yarn and npm as well. I couldn't reproduce it locally with pnpm, but I could on the stackblitz repro. The preview works locally with all the package managers (this is something I would expect, because Vite is a different animal) but fails on stackblitz.
Under pnpm, the binary file in node_modules/.bin
contains path information whereas npm and yarn are just straight up copies of the target file. Under pnpm, the compiled template file has context as to where it's being run, so it can use the local node_modules
. Apparently on npm/yarn, this is not the case.
I'll revert that change shortly and publish a fix.
@lordelogos same result with yarn run
@shellscape Thanks for the fast response and fix. I can confirm that in 1.7.3 the issue is no longer present.
@jsxp-email/cli
Version?:Expected Behavior
Running email build ./templates/Reproduction.tsx should successfully build the template.
Running email check ./templates/Reproduction.tsx should successfully run the compatibility check.
Actual Behavior
Throws and error instead: Error: Cannot find module 'jsx-email'
Additional Information
The behaviour is the same in local Windows environment as in repro link.