Skip to content
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

When using jest-editor-support from cdn, fails to locate the parse named method #107

Open
cbarrerah opened this issue Jul 21, 2023 · 0 comments

Comments

@cbarrerah
Copy link

Hi there,
Maybe it is a silly mistake, but I am trying to use the parse method in one tampermonkey script that I am transpiling with vite-monkey-plugin. The rest of the set up was crazy to get working, but in the end managed to make it work.
Now I am trying to use the parse method in one piece of typescript code:

import { parse } from "https://cdn.jsdelivr.net/npm/jest-editor-support/build/index.min.js";
and calling it like:

const parsedSpecFile = parse(path, contents);

When opening the page that calls this code, it complains without even reaching the part of the code that executes this call:

Uncaught SyntaxError: The requested module 'https://cdn.jsdelivr.net/npm/jest-editor-support/build/index.min.js' does not provide an export named 'parse' (at SpecFileItDescription.tsx:8:10)

As far as I understand, the part that actually generates the named export is in index.js on build folder:
Object.defineProperty(exports, "parse", { enumerable: true, get: function get() { return _parsers["default"]; } });

And in the browser, it gets rightfully detected as:
Object.defineProperty(exports, "parse", { enumerable: !0, get: function() { return _parsers.default } });

So any idea what might cause such a weird behaviour?
Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant