jrgarciadev/react-iconly

No support for Vite/Typescript

SalahAdDin opened this issue · 3 comments

Hello, thanks for your package

I wanted to user this package as icon provider, but I am getting this error with Vite:

Uncaught ReferenceError: process is not defined
    s2 factoryWithTypeCheckers.js:170
    i2 factoryWithTypeCheckers.js:241
    exports factoryWithTypeCheckers.js:116
    Q index.js:9
    u context.js:34
    <anonymous> factoryWithThrowingShims.js:16

Why?

I also want to ask for Plug and List  icons.

Thanks

You can fix add define in your vite.config.ts

export default defineConfig({
  ...
  define: {
    'process.env': {},
  }
});

You can fix add define in your vite.config.ts

export default defineConfig({
  ...
  define: {
    'process.env': {},
  }
});

Yeah, it worked for me, but, why?

@SalahAdDin Vitejs not use process.env not exist in the environment Vitejs use import.meta.env then we're resolving the process.env like a object empty

More info of Vitejs => https://vitejs.dev/guide/env-and-mode.html