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

出现大量文件路径错误 #112

Open
GuoDapeng opened this issue Jan 24, 2024 · 3 comments
Open

出现大量文件路径错误 #112

GuoDapeng opened this issue Jan 24, 2024 · 3 comments

Comments

@GuoDapeng
Copy link

Failed to parse source map from '/Users/felix/Documents/MobileWork/work/数据大屏/tsrsdv/scene_drill/node_modules/@antv/util/esm/path/convert/src/path/convert/path-2-absolute.ts' file: Error: ENOENT: no sfile or directory, open '/Users/felix/Documents/MobileWork/work/数据大屏/tsrsdv/scene_drill/node_modules/@antv/util/esm/path/convert/src/path/convert/path-2-absolute.ts'

底下还有很多很多

在安装后,使用就会出现大量这样的路径错误。

下面是复现问题的步骤:

yarn create react-app scene --template typescript
cd scene
yarn add @antv/util

修改 App.tsx 文件:

import React from 'react';
import logo from './logo.svg';
import './App.css';
// 添加一行
import { gradient } from '@antv/util';

function App() {
  // 添加另一行
  console.log('gradient',gradient)
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.tsx</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

之后执行 yarn start 命令就可以看见大量 .ts 找不到了。

好像不影响使用,只是日志很长,看不见 On Your Network 了。

@GuoDapeng
Copy link
Author

忽然发现项目目录创建 .env文件,里面写:

GENERATE_SOURCEMAP=false

这样就抑制了大量日志,但是浏览器调试会有一点点困难……

@hustcc
Copy link
Member

hustcc commented Jan 26, 2024

有兴趣来一个 PR 吗,只需要构建的时候输出 sourcemap,然后发包带上即可。

@GuoDapeng
Copy link
Author

我是一个很初级的程序员,我完全不理解 sourcemap 是怎么在这个项目立面生成的……很遗憾我没能把握住参与这个项目的机会。

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

2 participants