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

Vite crush when use theme-ui with vite-plugin-linter #2406

Open
sikhaman opened this issue Mar 23, 2023 · 0 comments
Open

Vite crush when use theme-ui with vite-plugin-linter #2406

sikhaman opened this issue Mar 23, 2023 · 0 comments

Comments

@sikhaman
Copy link

Describe the bug
When use theme-ui with Vite and include plugin vite-plugin-linter, dev server fails with error

To Reproduce
Steps to reproduce the behavior:

  1. create new project with vite
    yarn create vite my-react-app --template react-ts
  2. go inside folder and install all dependencies and vite-plugin-linter
  3. open file vite.config and add next code
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import EsLint from 'vite-plugin-linter'
const { EsLinter, linterPlugin } = EsLint

// https://vitejs.dev/config/
export default defineConfig((configEnv) => ({

  plugins: [
    react(),
    linterPlugin(
      {
        include: ['./src/**/*.{ts,tsx}'],
        exclude: ['./src/**/*.test.{ts,tsx}'],
        linters: [new EsLinter({ configEnv })],
      }
    ),
  ],

}))

  1. go to App.tsx and just import there theme provider import { ThemeProvider } from "theme-ui";
  2. run the app yarn dev

Expected behavior
All is running and cool

Screenshots
Dev server breaks with an errors

Additional context

node:internal/event_target:916
  process.nextTick(() => { throw err; });
                           ^
Error: No ESLint configuration found in /Users/dorado/Desktop/repos/my-vue-app/src.
    at CascadingConfigArrayFactory._finalizeConfigArray (/Users/dorado/Desktop/repos/my-vue-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3977:19)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/dorado/Desktop/repos/my-vue-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3768:21)
    at CLIEngine.isPathIgnored (/Users/dorado/Desktop/repos/my-vue-app/node_modules/eslint/lib/cli-engine/cli-engine.js:989:18)
    at ESLint.isPathIgnored (/Users/dorado/Desktop/repos/my-vue-app/node_modules/eslint/lib/eslint/eslint.js:681:26)
    at EsLinter.lint (/Users/dorado/Desktop/repos/my-vue-app/node_modules/vite-plugin-linter/dist/linters/EsLinter.js:71:37)
    at EsLinter.lintServe (/Users/dorado/Desktop/repos/my-vue-app/node_modules/vite-plugin-linter/dist/linters/EsLinter.js:59:36)
    at MessagePort.<anonymous> (/Users/dorado/Desktop/repos/my-vue-app/node_modules/vite-plugin-linter/dist/lintWorkerThread.js:48:24)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
Emitted 'error' event on Worker instance at:
    at Worker.[kOnErrorMessage] (node:internal/worker:289:10)
    at Worker.[kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  messageTemplate: 'no-config-found',
  messageData: { directoryPath: '/Users/dorado/Desktop/repos/my-vue-app/src' }
}
error Command failed with exit code 1.

So I do not know if it is a problem with Vite itself, vite-plugin-linter, or with theme-ui. And my question is how to fix it?

@sikhaman sikhaman changed the title Vite crush on use theme-ui Vite crush when use theme-ui with vite-plugin-linter Mar 24, 2023
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