gxmari007 / vite-plugin-eslint

🚨 ESLint plugin for vite
MIT License
266 stars 44 forks source link

ERROR [vite-plugin-eslint] a is not a function #53

Open lionnnnn opened 1 year ago

lionnnnn commented 1 year ago
 ERROR  [vite-plugin-eslint] a is not a function                                                                                                                                                         17:58:39  
file:  virtual:__remoteEntryHelper__

 ERROR  error during build:                                                                                                                                                                              17:58:39  
TypeError: a is not a function
    at Object.transform (E:\PROJECT\xaas-fees-center\node_modules\.pnpm\vite-plugin-eslint@1.8.1_eslint@8.29.0+vite@2.9.15\node_modules\vite-plugin-eslint\dist\index.js:1:2334)
    at E:\PROJECT\xaas-fees-center\node_modules\.pnpm\rollup@2.77.3\node_modules\rollup\dist\shared\rollup.js:22826:37

 ELIFECYCLE  Command failed with exit code 1.

My vite-plugin-eslint version is 1.3.0

        // vite.config.ts
        plugins: [
            eslintPlugin()
        , ....]

I wonder is that anything wrong after I just upgrade my pnpm to 7.0? Should I upgrade vite-plugin-eslint at the same time ?

woodreamz commented 1 year ago

I am switching one of my repository to a monorepo and I am facing the same issue, it's not related to pnpm, I have the same issue with yarn.

If I remove the vite-eslint-plugin from my vite.config, it's working well. I can't figure out what's happening :/

TypeError: a is not a function
 ❯ TransformContext.transform node_modules/.pnpm/vite-plugin-eslint@1.8.1_eslint@8.40.0_vite@4.3.7/node_modules/vite-plugin-eslint/dist/index.js:1:2334
 ❯ Object.transform node_modules/.pnpm/vite@4.3.7_@types+node@20.1.6/node_modules/vite/dist/node/chunks/dep-1f986b87.js:42919:44
 ❯ loadAndTransform node_modules/.pnpm/vite@4.3.7_@types+node@20.1.6/node_modules/vite/dist/node/chunks/dep-1f986b87.js:53385:29
nick4fake commented 1 year ago

@lionnnnn Related to @originjs/vite-plugin-federation?

nick4fake commented 1 year ago

Fix: https://github.com/sunghwan2789/vite-plugin-eslint/commit/2aeda77f4eea108454909ea192b34dbed10e1f73