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

Esbuild in JS : Uncaught Error: Module not found in bundle: ./assets/app_lens #7267

Closed
bisanedev opened this issue Oct 8, 2023 · 1 comment
Labels

Comments

@bisanedev
Copy link

maybe there are tips and tricks for using esbuild js, to display icons ??
Key information

  • EUI version: 88.5.4
  • React version: 18.2.0
  • Build tool: (esbuild)

Minimum reproducible sandbox

esbuid config

import esbuild from "esbuild";
import {sassPlugin} from "esbuild-sass-plugin";

esbuild.build({
  logLevel: "info",
  entryPoints: ["./resources/javascript/main.js"],
  outfile: "./public/assets/bundle.js",
  bundle: true,
  loader: {
    ".js": "jsx",    
    ".png": "dataurl",
    ".webp": "dataurl",
    ".woff": "dataurl",
    ".woff2": "dataurl",
    ".eot": "dataurl",
    ".ttf": "dataurl",
    ".svg": "dataurl",
  },
  plugins: [sassPlugin()]
}).catch((error) => {
  console.error(error);
  process.exit(1);
});
@cee-chen
Copy link
Contributor

cee-chen commented Oct 9, 2023

This is likely the same underlying issue as vite/rollup: #5463

I'll go ahead and modify the linked issue title to reflect the additional build tool, and close this one in as a duplicate.

In the interim, we recommend using the appendIconComponentCache API to cache icons that you use ahead of time: https://github.com/elastic/eui/tree/main/wiki/consuming-eui#failing-icon-imports

@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants