Closed FrankVisuals closed 2 years ago
@FrankVisuals - I'll try to look into this later tonight, but in the meantime, can you try with both 1.4.0 and 1.3.0? 1.3.0 only had a default export, not any named exports. 1.4.0 flipped the package.json file for the project from cjs to esm and added the named exports.
:tada: This issue has been resolved in version 1.4.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@FrankVisuals - it looks like it was caused by the exports.default
in jse-eval
's package.json file. I tested with your provided example and it seemed to work properly now with the 1.4.1 release. Thank you for reporting this issue!
Thanks for the fast solution! I was just about to test it with 1.3 which forced me to use
import { default } from "jse-eval"
- I'll give it a try with 1.4.1 :) !
I have a typescript project where I import
jse-eval
- the typescript build works fine, but when executing the built files, it will fail with Error[ERR_REQUIRE_ESM]: Must use import to load ES Module
I've created a very lightweight repo to reproduce this issue: https://github.com/FrankVisuals/error-showcase
I did not find any way (changing to require instead of import, or import * as ...) to get it running when using a typescript build before.
The
Is built to
Based on the package.json I would expect
require("jse-eval")
to target the.cjs
version. The full error shown below, indicates the module is tried to be loaded:My node version is v14.19.0 My npm version is 8.5.5 MacOs 12.2.1
Is this an expected behaviour? Based on the docs it seems that this should actually work.