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

[bug] import failure i is not a function #322

Closed
Mitoax opened this issue Dec 9, 2022 · 5 comments · Fixed by #323
Closed

[bug] import failure i is not a function #322

Mitoax opened this issue Dec 9, 2022 · 5 comments · Fixed by #323

Comments

@Mitoax
Copy link

Mitoax commented Dec 9, 2022

import { Marp } from "@marp-team/marp-core";

caused error:

image

@yhatt
Copy link
Member

yhatt commented Dec 9, 2022

i means emoji-regex module. Is this code throwing some errors in your code context?

import emojiRegex from 'emoji-regex'

@Mitoax
Copy link
Author

Mitoax commented Dec 9, 2022

i means emoji-regex module. Is this code throwing some errors in your code context?

import emojiRegex from 'emoji-regex'

No error for this import

@yhatt
Copy link
Member

yhatt commented Dec 9, 2022

OK, could you share a minimal reproducible example project? A code you've described is working on Node.js module without any errors.

If you are using a bundler, it may have met some kind of troubles about CommonJS interop from ESM.

@yhatt
Copy link
Member

yhatt commented Dec 11, 2022

We have met exactly same situation in marp-team/marp-vscode. Here is a workaround:
https://github.com/marp-team/marp-vscode/blob/23e905b970c81629353be31b564d50aadb2a8bc2/webpack.base.config.js#L7-L13

#323 may resolve bundler's confusion about default export in external emoji modules.

@yhatt
Copy link
Member

yhatt commented Dec 24, 2022

Confirmed it was fixed in v3.4.1.

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

Successfully merging a pull request may close this issue.

2 participants