unplugin / unplugin-turbo-console

🚀 Improve the Developer Experience of console
https://utc.yuy1n.io
MIT License
483 stars 10 forks source link

mac Jump to Editor doesn't work #8

Closed mercer08 closed 8 months ago

mercer08 commented 9 months ago

m2 pro系统Ventura13.4 package.json

{
  "name": "xxx",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "dev": "vite --force",
  },
  "dependencies": {
    "@ant-design/icons": "^4.7.0",
    "@emotion/core": "^11.0.0",
    "@emotion/react": "^11.10.5",
    "@emotion/styled": "^11.10.5",
    "@reduxjs/toolkit": "^1.9.0",
    "@sentry/react": "^7.73.0",
    "@sentry/tracing": "^7.42.0",
    "@tailwindcss/line-clamp": "^0.4.4",
    "antd": "^4.24.8",
    "antd-mobile": "^5.31.0",
    "axios": "^1.3.4",
    "buzz": "^1.2.1",
    "canvas-confetti": "^1.6.0",
    "clipboard": "^2.0.8",
    "dayjs": "^1.10.5",
    "depth-chart-hb": "^1.0.5",
    "dom-to-image-more": "^2.10.1",
    "echarts": "^5.1.2",
    "firebase": "^9.9.2",
    "hox": "^1.1.4",
    "i18next": "^20.4.0",
    "i18next-http-backend": "^1.4.0",
    "js-base64": "^3.6.1",
    "lightweight-charts": "^4.0.0",
    "lodash.debounce": "^4.0.8",
    "lodash.groupby": "^4.6.0",
    "lodash.throttle": "^4.1.1",
    "md5": "^2.3.0",
    "moment": "^2.29.1",
    "nanoid": "^3.1.23",
    "number-precision": "^1.6.0",
    "pubsub-js": "^1.9.3",
    "qrcode": "^1.5.0",
    "qrcode.react": "^1.0.1",
    "react": "^18.2.0",
    "react-copy-to-clipboard": "^5.1.0",
    "react-dom": "^18.2.0",
    "react-fast-marquee": "^1.6.0",
    "react-grid-layout": "^1.2.5",
    "react-helmet": "^6.1.0",
    "react-hot-toast": "^2.2.0",
    "react-i18next": "^11.16.6",
    "react-number-format": "^4.9.1",
    "react-redux": "^8.0.5",
    "react-router-dom": "^5.3.1",
    "typed.js": "^2.0.16",
    "use-count-up": "^3.0.1",
    "valtio": "^1.10.5"
  },
  "devDependencies": {
    "@babel/core": "^7.16.5",
    "@sentry/vite-plugin": "^0.4.0",
    "@tailwindcss/line-clamp": "^0.4.4",
    "@types/react": "^18.2.16",
    "@types/react-dom": "^18.2.7",
    "@typescript-eslint/eslint-plugin": "^6.2.0",
    "@typescript-eslint/parser": "^6.2.0",
    "@vitejs/plugin-legacy": "^4.0.2",
    "@vitejs/plugin-react": "^3.1.0",
    "@vitejs/plugin-react-swc": "^3.3.2",
    "autoprefixer": "^10.4.14",
    "eslint": "^8.45.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.3",
    "less": "^4.1.1",
    "postcss": "^8.4.21",
    "prettier": "^2.8.8",
    "rollup-plugin-external-globals": "^0.6.1",
    "rollup-plugin-visualizer": "^5.5.2",
    "tailwind-scrollbar": "^3.0.0",
    "tailwindcss": "^3.2.7",
    "typescript": "^5.1.6",
    "vite": "4.3.5",
    "vite-plugin-cdn-import": "^0.3.5",
    "vite-plugin-html": "^3.2.0",
    "vite-plugin-htmlx": "^1.0.3",
    "vite-plugin-radar": "^0.7.0",
    "vite-plugin-turbo-console": "^0.2.5",
    "vitest": "^0.25.3"
  }
}

vscode -> 版本: 1.84.0 node -> v16.20.1 npm -> 8.19.4

yuyinws commented 9 months ago

请尽可能提供以下信息:

  1. 包含console.log()的代码片段
  2. 控制台中输出的内容,特别是Jump to Editor后面的url
  3. 能够复现问题的最小重现版本
mercer08 commented 9 months ago
import { apiHost } from '@/src/env';

export const host = window.isRN() ? apiHost() : '';
// export const host = 'https://www.fairdesk.com';

console.log('apiHost', host);

export default {
  apiOrder: `${host}/order/v1`,
  apiConfig: `${host}/config/v1`,
  apiUser: `${host}/user/v1`,
};
i18n
  .use(backend)
  .use(initReactI18next)
  .init(
    {
      load: 'languageOnly',
      react: {
        useSuspense: false,
      },
      lng: i18nDefaultKey(),
      fallbackLng: i18nDefaultKey(),
      debug: false,
      parseMissingKeyHandler: () => {
        return '';
      },
      backend: {
        loadPath: (lng) => {
          console.log(lng);
          if (langUrl) {
            return langUrl;
          }
          let ver = langVersion;
          if (window.localStorage.getItem('fdweb')) {
            const config = JSON.parse(localStorage.getItem('fdweb'));
            ver =
              config?.langVersion > Number(langVersion)
                ? config?.langVersion
                : langVersion;
          }
          return `https://www.xxx.com/lang/fdweb/${ver}/${lng[0]}.json`;
        },
        parse: (data) => JSON.parse(data),
        crossDomain: true,
        withCredentials: false,
      },
      interpolation: {
        escapeValue: false,
      },
    },
    function (err, t) {
      console.log('[Lang is over]');
    }
  );
image

http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvY29uc3RhbnQvYXBpVXJsLmpzOjY6MQ== http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvY29uc3RhbnQvaW5kZXguanM6MjM6MQ== http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvbG9jYWwvZmRLb2wuanM6OTA6Mw== http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvbGFuZy9pMThuLmpzOjMxOjEx http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvbGFuZy9pMThuLmpzOjU0Ojc= http://localhost:3000/__tc/i.html#c3JjL2Jhc2UvbGFuZy9pMThuLmpzOjgzOjU=

yuyinws commented 9 months ago

尝试一下手动在浏览器中打开这个地址,看能否正常跳转 http://localhost:3000/__open-in-editor?file=src/base/lang/i18n.js:83:5

yuyinws commented 9 months ago

请升级到 v0.2.7 再试一下跳转是否有问题

mercer08 commented 9 months ago

尝试一下手动在浏览器中打开这个地址,看能否正常跳转 http://localhost:3000/__open-in-editor?file=src/base/lang/i18n.js:83:5

升级到 v0.2.7试了一下,直接在浏览器访问这个也无法打开 vscode,是不是和什么 vscode 配置相关呢

yuyinws commented 9 months ago

暂时不知道是什么原因导致的,可以按照以下步骤依次排查:

  1. clone 这个仓库(纯净的vite项目)并启动服务测试跳转,如何可以正常跳转,可能是原项目的vite插件存在冲突。

  2. 如何第一步还是异常, clone 这个仓库 (vite底层依赖的编辑器跳转库) 安装依赖后运行npm run test 看能否正常跳转

yuyinws commented 8 months ago

你好,最近插件使用unplugin进行了重构,请安装最新的版本使用,如还存在问题,欢迎另开issus.