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

Support for dynamic importing? #35

Open
nagibmahfuj opened this issue May 25, 2024 · 0 comments
Open

Support for dynamic importing? #35

nagibmahfuj opened this issue May 25, 2024 · 0 comments

Comments

@nagibmahfuj
Copy link

nagibmahfuj commented May 25, 2024

I am using vite in react.js and in my async function I am trying to dynamically import the package.

async function formatCode(code) {
  const { format } = await import("prettier/standalone");
  const plugin = await import("prettier-plugin-rust");
  return await format(code, {
    parser: "rust",
    tabWidth: 2,
    plugins: [plugin], // used plugins: plugin and the error is same
  });
}

Output Error

error
Couldn't resolve parser "rust". Plugins must be explicitly added to the standalone bundle.

Does this package support this kind of dynamic importing?

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