million icon indicating copy to clipboard operation
million copied to clipboard

Lint never connects to VS code

Open nxfi777 opened this issue 9 months ago • 33 comments

What version of million are you using?

0.0.73

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Firefox, Chrome

Describe the Bug

I was originally using CRA, but the craco method does not resolve for the craco plugin object. I now am using the webpack method alongside webpack-bundle-analyzer. Here is my config:

// craco.config.js
const BundleAanlyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const MillionCompiler = require('@million/lint');

module.exports = function () {
  return {
    webpack: {
      configure: {
        entry: './src/index.js',
      },
      plugins: [new BundleAanlyzerPlugin({ analyzerMode: "server" }), MillionCompiler.webpack()],
    },
  };
};

The million lint plugin is installed, and eslint is working correctly. The issue is that no matter how long I wait, or how much I play around with the site, million lint never connects to VS code in the dev server environment. The site is responsive, and I am using block for some static elements.

Million lint

image

What's the expected result?

Million lint detects issues in my CSR SPA

Link to Minimal Reproducible Example

--

Participation

  • [X] I am willing to submit a pull request for this issue.

nxfi777 avatar May 03 '24 22:05 nxfi777

Thanks for opening this issue! A maintainer will review it soon.

github-actions[bot] avatar May 03 '24 22:05 github-actions[bot]

I have the same issue, I intentionally wrote very bad code but it didn't report any of them. Then, I cloned the slow application referenced in the announcement and played around the app and it didn't detect any issue.

For context, I don't see the "Connecting to Visual Studio Code" like the OP.

AhmedBaset avatar May 06 '24 18:05 AhmedBaset

Same issue here, it does not connect to VScode at all. Just shows the toolbar saying "connecting to vscode"

sannajammeh avatar May 07 '24 11:05 sannajammeh

Facing the same issue here. Everything is same as the OP except I'm using Vite on mac.

roymrinmoy avatar May 14 '24 18:05 roymrinmoy

Hello there @nxfi777, @AhmedBaset, @sannajammeh, @roymrinmoy we have actually fixed this issue in the upcoming release and you will no longer experience this; apologies for the not so great first encounter.

tobySolutions avatar May 21 '24 08:05 tobySolutions

It's still not connecting.

karthikmallireddy avatar May 21 '24 17:05 karthikmallireddy

It's still not connecting.

Have you updated to 1.0.0-rc.1?

AhmedBaset avatar May 21 '24 17:05 AhmedBaset

Yes but it's keep saying start dev server in VS Code.

karthikmallireddy avatar May 21 '24 18:05 karthikmallireddy

POST http://undefined:42423/ingest?z=1 net::ERR_NAME_NOT_RESOLVED

Stanzilla avatar May 22 '24 01:05 Stanzilla

having same issue

RishabhTayal avatar May 22 '24 03:05 RishabhTayal

please stop replying with "same issue" if you dont have anything extra to add.

ive updated to 1.0.0-rc.1 and im using the webpack provider. still having issues.

@tobySolutions can you confirm which version this is meant to be fixed in?

ImLunaHey avatar May 22 '24 09:05 ImLunaHey

guessing this is related? ive tried the onboarding a few times now and every time the callback page just shows a blank page. i dont get redirected to a vscode:// url or anything.

Screenshot 2024-05-22 at 7 57 22 PM

ImLunaHey avatar May 22 '24 10:05 ImLunaHey

I have opened a question regarding the same issue this morning in the Discord server. Including the reproduction steps.

Hi, I'm excited to use Million Lint but I can't seem to login.

I've installed Million and MillionLint and installed the vscode extension. After which it guided me to authenticate using google or github. But after signing in with either of the options, it did not actually sign me in.

I'm still stuck on https://beta-million-lint.vercel.app/auth/callback in the browser.

I've tried using Arc and firefox but neither seem to solve the issue.

Steps:

  1. I get the prompt to sign in, I click Allow.
  2. I get the vscode confirmation to open the link to an external website, I click Open.
  3. I sign in using GitHub
  4. I get the authorization screen for Clerk, I click Authorize.
  5. It tells me I'm redirected, after which I'm redirected to a blank page with the auth/callback url from above.

The plugin in vscode stays unauthenticated.

jessedubbink avatar May 22 '24 10:05 jessedubbink

update. i managed to get an account made and the extension is now authenticated. i had to go through the login process a LOT of times though, finally on the last time it seems to have worked.

ImLunaHey avatar May 22 '24 23:05 ImLunaHey

hey folks – we're working on it. merging the folks from #994 here

aidenybai avatar May 23 '24 06:05 aidenybai

@Stanzilla

POST http://undefined:42423/ingest?z=1 net::ERR_NAME_NOT_RESOLVED

This should be fixed! Please update your npm package and try again

npx @million/lint@latest

NisargIO avatar May 23 '24 06:05 NisargIO

Screenshot 2024-05-23 at 1 07 41 PM Updated to RC7 version and issue remains same it's a blank next js project Please find the attached screenshot.

karthikmallireddy avatar May 23 '24 07:05 karthikmallireddy

Updated to rc7 and I got different error message in console. It's a blank layout component using react router v6

截圖 2024-05-23 下午5 35 02

截圖 2024-05-23 下午5 38 01

截圖 2024-05-23 下午5 39 28

BrandonTing avatar May 23 '24 09:05 BrandonTing

@karthikmallireddy

We're not 100% sure why this is happening. We made the following changes:

  • We listen on both localhost and 0.0.0.0, previously just localhost
  • We migrated from a file coordinating strategy to a server that holds the coordination map
  • We have indicators to tell you which connection step you're on:
image

You can upgrade by installing the latest VSCode extension (v0.1.4) and upgrading Million Lint. This should help you upgrade:

npx million@latest

aidenybai avatar May 24 '24 11:05 aidenybai

i've got a webpack.config.ts and get the following when running the above command.

 No build tool detected. No configuration file found in the current path: /Users/luna/code/axiomhq/app/frontend 

ImLunaHey avatar May 24 '24 11:05 ImLunaHey

i've got a webpack.config.ts and get the following when running the above command.


 No build tool detected. No configuration file found in the current path: /Users/luna/code/axiomhq/app/frontend 

Separate issue, I suggest opening a new issue for this. Are you using craco? What framework are you using?

nxfi777 avatar May 24 '24 11:05 nxfi777

Are you using craco? no

What framework are you using? webpack + react

ImLunaHey avatar May 24 '24 11:05 ImLunaHey

@karthikmallireddy

We're not 100% sure why this is happening. We made the following changes:

  • We listen on both localhost and 0.0.0.0, previously just localhost
  • We migrated from a file coordinating strategy to a server that holds the coordination map
  • We have indicators to tell you which connection step you're on:
image You can upgrade by installing the latest VSCode extension (v0.1.4) and upgrading Million Lint. This should help you upgrade:
npx million@latest

@aidenybai Thanks,After the new update it's now connected to visual studio code but react app is showing as not connected but core webvitals still showing as not connected despite dev mode is running in background. Screenshot 2024-05-24 at 6 17 15 PM

karthikmallireddy avatar May 24 '24 19:05 karthikmallireddy

It has worked on my project after upgrade to latest. Thanks for fixing.

BrandonTing avatar May 25 '24 09:05 BrandonTing

have a vite project with latest versions of million and million lint, I still see

  • ingest server: not connected
  • react app: not connected

in the browser I see healthcheck XHRs being made as well as the browser console reports

[Million Lint] Ingested 356 events 

Finally note that my react app is missing a few components after installing million lint (I did install million as well as I wasnt sure if it was needed or not). Also the installer reported an error and I did the vite configuration manually.

rburgst avatar May 25 '24 13:05 rburgst

If that can help, I had to remove --turbo from my next dev command to make it connect to the extension.

QuiiBz avatar May 27 '24 12:05 QuiiBz

I have the same issue as @karthikmallireddy now

imdavidkelly avatar May 29 '24 07:05 imdavidkelly

After removing --turbo flag from next dev, it starts working. If the vscode extension is stuck on Ingest server and React app not connected, I'd reload the local development server.

> next dev

  ▲ Next.js 14.2.3
  - Local:        http://localhost:3000
  - Environments: .env

 ✓ Starting...

 ⚡ Million Lint v1.0.0-rc.13
 - Local server: http://localhost:42423

My npm packages:

"@million/lint": "1.0.0-rc.13",
"million": "^3.1.6",
"next": "14.2.3",
"react": "^18",
"react-dom": "^18",

lovincyrus avatar May 30 '24 04:05 lovincyrus

I don't have the --turbo flag, I get the million lint to ingest and can see Ingesting in my console but the VSCode plugin still does not work, I've tried with different projects but the plugin seems stuck, I installed previous version as well, disabled, uninstalled an reinstalled but get same results. image image image

I have installed using npx million@latest

My packages

     "@million/lint": "^1.0.0-rc.18",
     "million": "^3.1.7",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "next": "^14.2.3",

I do have a somewhat complicated next.config.js

const MillionLint = require('@million/lint');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true'
});

const withPWA = require('@ducanh2912/next-pwa').default({
  dest: 'public',
  disable: process.env.NODE_ENV === 'development'
});
const nextConfig = {
  reactStrictMode: true,
  images: {
    remotePatterns: [{
      protocol: 'https',
      hostname: 'www.notion.so'
    }]
  },
  webpack(config, {
    isServer
  }) {
    if (!isServer) {
      config.externals.push('sharp');
    }
    config.module.rules.push({
      test: /\.(ogg|mp3|wav|mpe?g)$/i,
      exclude: config.exclude,
      use: [{
        loader: require.resolve('url-loader'),
        options: {
          limit: config.inlineImageLimit,
          fallback: require.resolve('file-loader'),
          publicPath: `${config.assetPrefix}/_next/static/images/`,
          outputPath: `${isServer ? '../' : ''}static/images/`,
          name: '[name]-[hash].[ext]',
          esModule: config.esModule || false
        }
      }]
    });

    // shader support
    config.module.rules.push({
      test: /\.(glsl|vs|fs|vert|frag)$/,
      exclude: /node_modules/,
      use: ['raw-loader', 'glslify-loader']
    });
    return config;
  },
  experimental: {
    nextScriptWorkers: true
  }
};
const KEYS_TO_OMIT = ['webpackDevMiddleware', 'configOrigin', 'target', 'analyticsId', 'webpack5', 'amp', 'assetPrefix'];
module.exports = (_phase, {
  defaultConfig
}) => {
  const plugins = [[withPWA], [withBundleAnalyzer, {}]];
  const wConfig = plugins.reduce((acc, [plugin, config]) => plugin({
    ...acc,
    ...config
  }), {
    ...defaultConfig,
    ...MillionLint.next({ rsc: true })(nextConfig)
  });
  const finalConfig = {};
  Object.keys(wConfig).forEach(key => {
    if (!KEYS_TO_OMIT.includes(key)) {
      finalConfig[key] = wConfig[key];
    }
  });
  return (finalConfig);
};

roeku avatar May 31 '24 17:05 roeku

Having same problem. On the app I have bar with this text: Failed to connect. Is your VSCode window open?

Versions: Extension: v0.1.8 milion: 3.1.7 milion/lint: 1.0.0-rc.18 VSCode: 1.89.1 Node: v20.10.0 Vite: 4.4.5 React: 18.2.0

I am stuck on Ingest server and React app - not connected

image

When I load the page I get some logs:

image

I tried to fiddle with some vite.config.ts settings, but it did not help:

import MillionLint from '@million/lint';
import million from 'million/compiler';
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import sassGlobImports from "vite-plugin-sass-glob-import";
import svgr from "vite-plugin-svgr";
import tsconfigPaths from "vite-tsconfig-paths";

// https://vitejs.dev/config/
const _plugins = [react(), svgr(), tsconfigPaths(), sassGlobImports()];
_plugins.unshift(million.vite({
  auto: true
}), MillionLint.vite())
export default defineConfig({
  plugins: _plugins,
  server: {
    host: true,
    port: 3000,
    strictPort: true,
    watch: {
      usePolling: true
    },
    hmr: {
      clientPort: 3000,
      overlay: false
    }
  },
  define: {
    global: "window",
    "process.env.VITE_GITHUB_USERNAME": JSON.stringify(process.env.VITE_GITHUB_USERNAME)
  },
  build: {
    sourcemap: true,
    minify: "terser"
  },
  css: {
    postcss: "./postcss.config.js"
  },
  publicDir: "public"
});

Console: image

matej-kaska avatar May 31 '24 17:05 matej-kaska