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

Failed to import - micromark #179

Closed
talentlessguy opened this issue Sep 25, 2021 · 12 comments
Closed

Failed to import - micromark #179

talentlessguy opened this issue Sep 25, 2021 · 12 comments
Labels
bug Something isn't working

Comments

@talentlessguy
Copy link
Contributor

talentlessguy commented Sep 25, 2021

Failing module

import { micromark } from 'https://esm.sh/micromark'

Error message

After running deno run I get this:

error: Uncaught SyntaxError: The requested module '/v53/micromark@3.0.5/deno/lib/compile.js' does not provide an export named 'compile'
    at <anonymous> (https://cdn.esm.sh/v53/micromark@3.0.5/deno/lib/preprocess.js:2:8)

Additional info

  • esm.sh version: v53
  • Deno version: 1.14.1

Related: #135

@talentlessguy talentlessguy added the bug Something isn't working label Sep 25, 2021
@talentlessguy
Copy link
Contributor Author

still having this error on v55:

Download https://cdn.esm.sh/v55/micromark-util-classify-character@1.0.0/deno/micromark-util-classify-character.js
error: Uncaught SyntaxError: The requested module '/v55/micromark@3.0.7/deno/lib/compile.js' does not provide an export named 'compile'
    at <anonymous> (https://cdn.esm.sh/v55/micromark@3.0.7/deno/lib/preprocess.js:2:8)

@talentlessguy
Copy link
Contributor Author

now there is this error:

/* esm.sh - error */
throw new Error("[esm.sh] " + "open /tmp/esm-build-51f68c63852483f342490b39fc2b713cc1da1a2d-22c5ca0c/node_modules/micromark/package.json: no such file or directory");
export default null;

@ije
Copy link
Member

ije commented Jan 4, 2022

Screenshot 2022-01-04 at 23 58 44

seems it works on my local server

@talentlessguy
Copy link
Contributor Author

@ije could you clean up the build dir for CDN then please

@aiotter
Copy link

aiotter commented Feb 1, 2022

Still having a problem in importing micromark@3.0.10.

> import { micromark } from 'https://esm.sh/micromark@3.0.10'
Uncaught SyntaxError: The requested module '/v64/micromark@3.0.10/deno/lib/postprocess.js' does not provide an export named 'postprocess'
    at async <anonymous>:2:29
// https://esm.sh/micromark@3.0.10/deno/lib/postprocess.js

/* esm.sh - error */
throw new Error("[esm.sh] " + "parseCJSModuleExports: Package path ./deno/lib/postprocess is not exported from package /tmp/esm-build-1af3155c4d51507d2cc6db59e44781bab679561a-505e9804/node_modules/micromark (see exports field in /tmp/esm-build-1af3155c4d51507d2cc6db59e44781bab679561a-505e9804/node_modules/micromark/package.json)");
export default null;

You can see a function postprocess is exported here.
https://github.com/micromark/micromark/blob/3.0.10/packages/micromark/dev/lib/postprocess.js

@wooorm
Copy link

wooorm commented Feb 6, 2022

Similar on v65:

$ deno eval 'import { micromark } from "https://esm.sh/micromark"'

Yields:

Download https://esm.sh/micromark
Download https://cdn.esm.sh/v65/micromark@3.0.10/deno/micromark.js
Download https://cdn.esm.sh/v65/micromark@3.0.10/dev/index.d.ts
Download https://cdn.esm.sh/v65/micromark-util-types@1.0.2/index.d.ts
error: Uncaught SyntaxError: The requested module '/v65/micromark@3.0.10/deno/lib/parse.js' does not provide an export named 'parse'
    at <anonymous> (https://cdn.esm.sh/v65/micromark@3.0.10/deno/lib/preprocess.js:2:76)

For some reason /deno/lib/parse.js on the CDN does not match what’s in the source. Instead, it matches the project’s main file (which is at /deno/index.js)

@ije ije closed this as completed in 8fb846f Feb 7, 2022
@wooorm
Copy link

wooorm commented Feb 7, 2022

Awesome!

@ije
Copy link
Member

ije commented Feb 7, 2022

the exports of package.json is totally chaos...anyway fixed in v66

import { micromark } from "https://esm.sh/micromark?pin=v66"

Screen Shot 2022-02-07 at 22 31 35

@ije
Copy link
Member

ije commented Feb 7, 2022

@wooorm btw micromark is amazing!

@aiotter
Copy link

aiotter commented Feb 7, 2022

Nice work!

@aiotter
Copy link

aiotter commented Feb 7, 2022

Thanks for v66, I finally succeed in importing MDX in deno!
Thank you again to @ije, and to @wooorm for great micromark package! I'll use micromark instead of markdown-it ;-)

import "https://esm.sh/@mdx-js/mdx@v2.0.0?pin=v66&alias=astring:https://deno.land/x/astring@v1.8.1/src/astring.js";
Module {
  compile: [Function: T],
  compileSync: [Function: _],
  createProcessor: [Function: j],
  evaluate: [AsyncFunction: $e],
  evaluateSync: [Function: Ke],
  nodeTypes: [
    "mdxFlowExpression",
    "mdxJsxFlowElement",
    "mdxJsxTextElement",
    "mdxTextExpression",
    "mdxjsEsm"
  ],
  run: [AsyncFunction: L],
  runSync: [Function: N]
}

@ije
Copy link
Member

ije commented Feb 7, 2022

@aiotter cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants