Closed kasperpeulen closed 10 months ago
This is not the fault of jsx-email. We export both ESM and CJS. Please fill out the entire issue template next time.
Added a repro @shellscape
Your reproduction doesn't show an error on my end. Looks like it's working fine.
@shellscape I added now a stackblitz start command (node index.js
), you should see:
OK thanks we'll take a look
I've managed to reproduce this locally. ESM is such a pain. It may be a bit before we roll out a fix for this, it requires altering how our build process works significantly. If you can use TypeScript, I'd recommend doing so.
I think if you want to use typescript, the steps could be.
package.json
file in the dist/es
directory. With as only content:
{
"type": "module",
}
This avoid having to manually rename js
files to mjs
files.
node16
.js
file extensions to all relative imports in the source code. For example:
export * from './body.js';
alright, we're going to completely change up our build process in the next few days which should resolve this.
the next few days turned into a week. haven't forgotten about it, just got swamped with work. going to run some tests this evening.
@kasperpeulen should be resolved now. cheers
Hey, huge thanks for putting in the work to do this. You just unblocked me shipping the next version of my personal newsletter platform. Can't wait for my emails to look ✨ beautiful ✨!
@jsx-email/all
(but for others the same apply)@jsxp-email/cli
Version?: Not usedExpected Behavior
I should be able to run jsx-email in node in projects that are "type:module":
Actual Behavior
I get an error:
Additional Information
I think this can be fixed by making sure that the ESM build outputs
.mjs
files.I tried renaming the esm output files locally in node_modules and that worked.