【问题标题】:Failed to parse source map... Error: ENOENT: no such file or directory无法解析源映射...错误:ENOENT:没有这样的文件或目录
【发布时间】:2022-07-06 00:16:37
【问题描述】:

问题是当我运行yarn start 时出现一些警告:

WARNING in ./node_modules/@usedapp/core/dist/esm/src/providers/transactions/reducer.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/mac/Desktop/react-django-nft-marketplace/react_django_nft_marketplace/frontend/frontend/node_modules/@usedapp/core/dist/esm/src/providers/transactions/reducer.js.map' file: Error: ENOENT: no such file or directory, open '/Users/mac/Desktop/react-django-nft-marketplace/react_django_nft_marketplace/frontend/frontend/node_modules/@usedapp/core/dist/esm/src/providers/transactions/reducer.js.map'
 @ ./node_modules/@usedapp/core/dist/esm/src/providers/transactions/provider.js 8:0-47 23:46-64
 @ ./node_modules/@usedapp/core/dist/esm/src/providers/DAppProvider.js 8:0-62 50:29-48
 @ ./node_modules/@usedapp/core/dist/esm/src/providers/index.js 1:0-31 1:0-31
 @ ./node_modules/@usedapp/core/dist/esm/src/index.js 2:0-28 2:0-28
 @ ./src/App.tsx 5:0-54 11:30-42 13:24-37 13:39-54
 @ ./src/index.tsx 7:0-24 11:33-36

102 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.68.0 compiled with 102 warnings in 2298 ms
Files successfully emitted, waiting for typecheck results...
Issues checking in progress...
No issues found.
^C
mbp:frontend mac$

我通过运行npx create-react-app frontend --template typescript 命令创建了react 应用程序。还有与我几乎相同的issue。但它没有解决。

【问题讨论】:

    标签: reactjs typescript


    【解决方案1】:

    您应该尝试在根目录(与 package.json 相同的文件夹)中创建一个 .env 文件,并将 GENERATE_SOURCEMAP=false 设置在一行:

    GENERATE_SOURCEMAP=false
    

    【讨论】:

    • 感谢您的回答!我试试看。
    【解决方案2】:

    最近更新0.11@usedapp/core 库解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-07
      • 1970-01-01
      • 2019-03-09
      • 2017-12-28
      • 2022-01-16
      • 2021-03-30
      • 1970-01-01
      相关资源
      最近更新 更多