-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set edition #307
Comments
Change your require or import statement to whichever entry in the editions section of the readme that you wish to require: https://github.com/bevry/istextorbinary#Editions eg. |
I did that, this doesn't work as described. The extra |
In fact, this is the require chain in my esbuild output: var { isBinary } = require_edition_es2022(); in there, there's a var textextensions_1 = __importDefault(require_textextensions()); which has a module2.exports = require_edition_es52().requirePackage(...) which runs the Edit: Indeed, I have changed the requires inside isextorbinary/edition-es2022/index.js to const textextensions_1 = __importDefault(require("textextensions/edition-es2022/index.js"));
// same for binaryextensions and removed the |
And again, getting this far is only possible because I have removed the
so this seems like two separate problems to me |
needs custom node_modules overwrites atm bevry/istextorbinary#307
Hrmm, yeah, seems then specifying which edition you want depends upon loader support, which CI coverage is for Node.js's loader and direct URL/path support (Deno, Browsers, etc). So this seems to be an issue with the bundler/loader of VSCode. Or could be that the module specs have changed once again... Perhaps the best way to workaround this, besides your hack in the OP. Is to update https://github.com/bevry/boundation to generate npm scripts and github actions to publish npm version tags for each edition, where it is the only edition in the bundle. Eg. textextensions@es2022 — this would also allow nested dep overrides. The ideal resolution of course would be if the bundlers and loaders adopt/support the editions spec, as the Editions spec is superior, as detailed on https://github.com/bevry/editions Might be best to continue here: bevry/editions#24 |
I'm developing a VSCode extension, this means CJS Node v18.
Running without any build step normally with
const xyz = require('istextorbinary')
works fine.But when building with esbuild and running the resulting bundle, I get
so I thought it had to do with the exotic setup, so I changed it to
require('istextorbinary/edition-es2022')
instead. But this also doesn't work (at all):Well yes... it is, said file includes
I'm not familiar with neither npm's
exports
nor youreditions
tool, but something's not right here.I also tried
require('istextorbinary/require')
but that yields the same output error (and the import is shown as invalid by tsserver).So I went ahead and just deleted the entire
"exports"
section from yourpackage.json
locally. Now the sub-import works, but with ESBuild, the same error as before. The autoloader fails to determine a suitable edition. This makes no sense yet again, as I have already specified one, why is it still doing that?And what do I do?
The text was updated successfully, but these errors were encountered: