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

Warning | Error: ENOENT - Failed to parse source map | no such file or directory #396

Closed
raulra08 opened this issue Jan 21, 2022 · 21 comments

Comments

@raulra08
Copy link

raulra08 commented Jan 21, 2022

Describe the bug
Following the readme in the repository, I decided to implement the Html5Qrcode solution so that I can scan both in desktop and browser.

Prior to that I did setup a ReactJS example application (using create react app) to implement the QR Code reader solution.

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repository
  2. Use the terminal to run npm install
  3. Run npm start
  4. Wait for the app to start
  5. See error in the Terminal

Expected behavior
No warnings or errors when running the application.

Screenshots
N/A

Desktop:

  • OS: macOS 11.6.2
  • Browser firefox
  • Version 95.0.2 (64-bit)

Smartphone:

  • Device: iPhone Xs
  • OS: iOS15.1
  • Browser firefox, safari
  • Version latest

Additional context

The application in the repository is also not showing the camera stream in the mobile phone's browser

Logs

Compiled with warnings.

Failed to parse source map from '/path/to/react_app/src/node_modules/src/camera.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/camera.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/code-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/code-decoder.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/core.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/core.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/experimental-features.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/experimental-features.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/html5-qrcode-scanner.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/html5-qrcode-scanner.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/html5-qrcode.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/html5-qrcode.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/image-assets.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/image-assets.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/index.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/native-bar-code-detector.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/native-bar-code-detector.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/state-manager.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/state-manager.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/storage.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/storage.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/strings.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/strings.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/ui.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/ui.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/utils.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/src/zxing-html5-qrcode-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/zxing-html5-qrcode-decoder.ts'

Failed to parse source map from '/path/to/react_app/src/node_modules/html5-qrcode/third_party/index.js.map' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/html5-qrcode/third_party/index.js.map'

src/pages/Dashboard/Dashboard.tsx
  Line 1:10:  'useEffect' is defined but never used  @typescript-eslint/no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

assets by status 2.6 MiB [cached] 2 assets
assets by path . 2.12 KiB
  asset index.html 1.67 KiB [emitted]
  asset asset-manifest.json 458 bytes [emitted]
cached modules 2.45 MiB (javascript) 31.3 KiB (runtime) [cached] 144 modules
./src/pages/Dashboard/Dashboard.tsx 4.14 KiB [built]

WARNING in ./node_modules/html5-qrcode/esm/camera.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/camera.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/camera.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 7:0-41 313:6-40
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/code-decoder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/code-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/code-decoder.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/core.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/core.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/core.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 3:0-53 3:0-53
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/experimental-features.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/experimental-features.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/experimental-features.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 30:0-76 125:114-180
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/html5-qrcode-scanner.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/html5-qrcode-scanner.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/html5-qrcode.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/html5-qrcode.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/html5-qrcode.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/image-assets.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/image-assets.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/image-assets.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 4:0-68 619:31-48 641:29-44
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/index.ts'
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/native-bar-code-detector.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/native-bar-code-detector.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/native-bar-code-detector.ts'
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 2:0-69 11:76-111 12:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/state-manager.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/state-manager.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/state-manager.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 4:0-58 4:0-58
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/storage.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/storage.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/storage.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 5:0-49 51:36-56
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/strings.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/strings.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/strings.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 27:0-47 195:17-57 199:15-61 442:23-71 445:21-71 716:25-58
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/ui.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/ui.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/ui.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 6:0-44 242:26-46
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/utils.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 28:0-47 80:11-61 469:16-66
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/src/zxing-html5-qrcode-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/src/zxing-html5-qrcode-decoder.ts'
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 1:0-71 14:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/third_party/zxing-js.umd.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/react_app/src/node_modules/html5-qrcode/third_party/index.js.map' file: Error: ENOENT: no such file or directory, open '/path/to/react_app/src/node_modules/html5-qrcode/third_party/index.js.map'
 @ ./node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js 1:0-53 6:68-95 6:134-159 6:200-227 6:268-295 6:336-363 6:405-433 6:478-509 6:551-579 6:616-639 6:679-705 6:744-769 6:810-837 6:877-903 6:949-981 6:1020-1045 6:1084-1109 6:1160-1197 9:9-14 17:14-51 34:27-50 35:30-68 36:27-45 36:50-71
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 1:0-71 14:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/pages/Dashboard/Dashboard.tsx 7:0-43 47:4-26 50:23-34
 @ ./src/App.tsx 9:0-52 34:40-49
 @ ./src/index.tsx 7:0-24 11:33-36
@MedinaGitHub
Copy link

same issue i use Typescript and React

@nazebzurati
Copy link

nazebzurati commented Mar 14, 2022

Description

This is reproducible with initial javascript create react app and html5-qrcode version 2.2.0.

To reproduce:

  1. Create new project with the npx create-react-app test command.
  2. Change dir into the new project created.
  3. Install html5-qrcode package npm i html5-qrcode.
  4. Apply the following patch.
    diff --git a/src/App.js b/src/App.js
    index 3784575..56169ba 100644
    --- a/src/App.js
    +++ b/src/App.js
    @@ -1,7 +1,22 @@
     import logo from './logo.svg';
     import './App.css';
    +import { Html5QrcodeScanner } from "html5-qrcode"
    +import { useEffect } from 'react';
     
     function App() {
    +
    +  function onScanSuccess(decodedText, decodedResult) {
    +    console.log(`Code matched = ${decodedText}`, decodedResult);
    +  }
    +  function onScanFailure(error) {
    +    console.warn(`Code scan error = ${error}`);
    +  }
    +  useEffect(() => {
    +    let html5QrcodeScanner = new Html5QrcodeScanner(
    +      "reader", { fps: 10, qrbox: { width: 250, height: 250 } }, false);
    +    html5QrcodeScanner.render(onScanSuccess, onScanFailure);
    +  });
    +
       return (
         <div className="App">
           <header className="App-header">
    @@ -17,6 +32,7 @@ function App() {
             >
               Learn React
             </a>
    +        <div id="reader" width="600px"></div>
           </header>
         </div>
       );
    
  5. Start the application npm run start.

Expected behaviour

No warning on compilation.

Desktop

  • Device: MacBook Pro (13-inch, Mid 2012)
  • OS: Fedora Linux 35 (Workstation Edition)
  • Browser: Google Chrome Version 99.0.4844.51 (Official Build) (64-bit)
  • Node.js: Node v16.14.0, NPM 8.5.4

Logs

Compiled with warnings.

Failed to parse source map from '/path/test/node_modules/src/camera.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/camera.ts'

Failed to parse source map from '/path/test/node_modules/src/code-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/code-decoder.ts'

Failed to parse source map from '/path/test/node_modules/src/core.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/core.ts'

Failed to parse source map from '/path/test/node_modules/src/experimental-features.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/experimental-features.ts'

Failed to parse source map from '/path/test/node_modules/src/html5-qrcode-scanner.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/html5-qrcode-scanner.ts'

Failed to parse source map from '/path/test/node_modules/src/html5-qrcode.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/html5-qrcode.ts'

Failed to parse source map from '/path/test/node_modules/src/image-assets.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/image-assets.ts'

Failed to parse source map from '/path/test/node_modules/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/index.ts'

Failed to parse source map from '/path/test/node_modules/src/native-bar-code-detector.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/native-bar-code-detector.ts'

Failed to parse source map from '/path/test/node_modules/src/state-manager.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/state-manager.ts'

Failed to parse source map from '/path/test/node_modules/src/storage.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/storage.ts'

Failed to parse source map from '/path/test/node_modules/src/strings.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/strings.ts'

Failed to parse source map from '/path/test/node_modules/src/ui.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/ui.ts'

Failed to parse source map from '/path/test/node_modules/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/utils.ts'

Failed to parse source map from '/path/test/node_modules/src/zxing-html5-qrcode-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/zxing-html5-qrcode-decoder.ts'

Failed to parse source map from '/path/test/node_modules/html5-qrcode/third_party/index.js.map' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/html5-qrcode/third_party/index.js.map'

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

assets by path static/ 2.53 MiB
  asset static/js/bundle.js 2.52 MiB [emitted] (name: main) 1 related asset
  asset static/js/node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.91 KiB [emitted] 1 related asset
  asset static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg 2.57 KiB [emitted] (auxiliary name: main)
asset index.html 1.67 KiB [emitted]
asset asset-manifest.json 546 bytes [emitted]
cached modules 2.39 MiB (javascript) 31.3 KiB (runtime) [cached] 138 modules

WARNING in ./node_modules/html5-qrcode/esm/camera.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/camera.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/camera.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 7:0-41 313:6-40
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/code-decoder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/code-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/code-decoder.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/core.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/core.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/core.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 3:0-53 3:0-53
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/experimental-features.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/experimental-features.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/experimental-features.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 30:0-76 125:114-180
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/html5-qrcode-scanner.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/html5-qrcode-scanner.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/html5-qrcode.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/html5-qrcode.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/html5-qrcode.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/image-assets.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/image-assets.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/image-assets.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 4:0-68 619:31-48 641:29-44
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/index.ts'
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/native-bar-code-detector.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/native-bar-code-detector.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/native-bar-code-detector.ts'
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 2:0-69 11:76-111 12:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/state-manager.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/state-manager.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/state-manager.ts'
 @ ./node_modules/html5-qrcode/esm/index.js 4:0-58 4:0-58
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/storage.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/storage.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/storage.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 5:0-49 51:36-56
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/strings.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/strings.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/strings.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 27:0-47 190:17-57 194:15-61 437:23-71 440:21-71 725:25-58
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/ui.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/ui.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/ui.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode-scanner.js 6:0-44 242:26-46
 @ ./node_modules/html5-qrcode/esm/index.js 2:0-60 2:0-60
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/utils.ts'
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 28:0-47 80:11-61 464:16-66
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/src/zxing-html5-qrcode-decoder.ts' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/src/zxing-html5-qrcode-decoder.ts'
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 1:0-71 14:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/html5-qrcode/third_party/zxing-js.umd.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/test/node_modules/html5-qrcode/third_party/index.js.map' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/html5-qrcode/third_party/index.js.map'
 @ ./node_modules/html5-qrcode/esm/zxing-html5-qrcode-decoder.js 1:0-53 6:68-95 6:134-159 6:200-227 6:268-295 6:336-363 6:405-433 6:478-509 6:551-579 6:616-639 6:679-705 6:744-769 6:810-837 6:877-903 6:949-981 6:1020-1045 6:1084-1109 6:1160-1197 9:9-14 17:14-51 34:27-50 35:30-68 36:27-45 36:50-71
 @ ./node_modules/html5-qrcode/esm/code-decoder.js 1:0-71 14:25-48
 @ ./node_modules/html5-qrcode/esm/html5-qrcode.js 29:0-49 125:22-37
 @ ./node_modules/html5-qrcode/esm/index.js 1:0-45 1:0-45
 @ ./src/App.js 8:0-50 24:33-51
 @ ./src/index.js 7:0-24 11:33-36

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

webpack 5.70.0 compiled with 16 warnings in 1656 ms

@nazebzurati
Copy link

As mentioned by alspdx in create-react-app repo's issue.

The problem is that the library's source files are being referenced but not being published, just the compiled code in the dist directory. I'm also having this issue with zod, there's an open issue about it and a PR to publish the source files which would fix the problem.

The content of camera.js.map (one of the files related to the warnings) is as follows:

{
    "version": 3,
    "file": "camera.js",
    "sources": [
        "../../src/camera.ts" // here
    ],
    ...
}

This is caused by webpack's source-map-loader package and it's advisable to not publish source map.

{
    "compilerOptions": {
        "target": "es5",
        "module": "ES2015",
        "sourceMap": false, // here (original: true)
        "moduleResolution": "Node",
        ...
    }
}

I've tried to disable source map in tsconfig.json (as shown above) and the warning still occurs when running npm run start but the warning reduced from 16 'Failed to parse source map' warnings to 1 warning when running npm run build. The 1 warning is as follows:

Failed to parse source map from '/path/test/node_modules/html5-qrcode/third_party/index.js.map' file: Error: ENOENT: no such file or directory, open '/path/test/node_modules/html5-qrcode/third_party/index.js.map'

@d8corp
Copy link

d8corp commented Mar 27, 2022

.env

GENERATE_SOURCEMAP=false

@raulra08
Copy link
Author

Solution found. Closing the issue.

Solution

  1. Create a .env file in the same directory where your package.json is
  2. Define the following variable GENERATE_SOURCEMAP=false as suggested by @d8corp

Thanks @d8corp and @nazebzurati

@jephphcr
Copy link

jephphcr commented Apr 4, 2022

Thanks!

@iamrosada
Copy link

Thanks :)

@Sk47R
Copy link

Sk47R commented Apr 19, 2022

Thanks. I want to know how it happened and how did adding GENERATE_SOURCEMAP=false solved the problem?

@Gayatri19670
Copy link

My Error:

Failed to parse source map from 'C:\Users\samir\Desktop\My Learning\sso-auth-react\node_modules@auth0\auth0-react\dist\auth0-react.esm.js.map' file: Error: ENOENT: no such file or directory, open 'C:\Users\samir\Desktop\My Learning\sso-auth-react\node_modules@auth0\auth0-react\dist\auth0-react.esm.js.map'

@raulra08
Copy link
Author

Hi @Sk47R I don't know how it happened.
What is available though is: steps to reproduce and the source code which I guess you or someone you know could try to debug this issue using the source code.

re: the sourcemap flag, I'd encourage you to read/research about source maps, understanding what's under the hood might bring some answers.

@raulra08
Copy link
Author

Hello, @Gayatri19670
This issue is closed and resolved.

However, it seems that your post belongs somewhere else as you seem to be using a very different dependency in your learning project, the auth0 library.
You might want to check if there are any similar issues raised in the past with the team who built that library.
In case this is helpful, using the npm website one can find out who maintains a library.
Good luck!

@Gayatri19670
Copy link

Thank you @raulra08

@srinivas-gangaraju
Copy link

Thanks @raulra08

simonas-notcat added a commit to decentralized-identity/agent-explorer that referenced this issue Jun 23, 2022
simonas-notcat added a commit to decentralized-identity/agent-explorer that referenced this issue Jun 23, 2022
* feat: metamask did provider

* fix: suppresing source map errors

mebjas/html5-qrcode#396 (comment)
veramo-bot pushed a commit to decentralized-identity/agent-explorer that referenced this issue Jun 23, 2022
@titenis
Copy link

titenis commented Jul 19, 2022

This issue is closed and resolved.

Sorry, but this doesn't look like a proper solution. Preventing the use of sourcemaps is not a solution, but just hiding the initial problem.
According to CRA, sourcemaps should be fixed in this package and those errors are this packages fault
facebook/create-react-app#11767 (comment)

@raulra08
Copy link
Author

Yes @titenis, I agree a better resolved it at its core than patched with a boolean value ;)
This deserves an issue on its own so it can be tracked and done, what do you think? would you please create one?

@titenis
Copy link

titenis commented Aug 1, 2022

Why create another issue? :)
This one already mentions everything about the problem.
I believe there are two ways to fix this:

  • disable sourcemap generation in this package
  • publish source code with dist files, so that source files could be actually found as the error suggests

@happyeric77
Copy link

Solution found. Closing the issue.

Solution

  1. Create a .env file in the same directory where your package.json is
  2. Define the following variable GENERATE_SOURCEMAP=false as suggested by @d8corp

Thanks @d8corp and @nazebzurati

Awesome!! thanks!!

mebjas pushed a commit that referenced this issue Mar 18, 2023
* fixed sourcemaps warnings

* fixed tsconfig lib

* enhance xcopy params
Ethan-Wu-juniper pushed a commit to Ethan-Wu-juniper/Insight-Message that referenced this issue Apr 22, 2023
@crisps0914
Copy link

Please add devtool: 'source-map' in webpack.config.js
and rebuild and publish the app to npm.
you can use this module without error.
thanks.

@pamelaotero
Copy link

Solution found. Closing the issue.

Solution

  1. Create a .env file in the same directory where your package.json is
  2. Define the following variable GENERATE_SOURCEMAP=false as suggested by @d8corp

Thanks @d8corp and @nazebzurati

Thank you for help, It worked

@sergeydushechkin
Copy link

sergeydushechkin commented Dec 7, 2023

Also, to remove warnings only for this package, you can add the following rule to the webpack config:

{
    test: /\.js$/,
    enforce: 'pre',
    use: [
        {
            loader: 'source-map-loader',
            options: {
                filterSourceMappingUrl: (url, resourcePath) => {
                    if (/html5-qrcode/i.test(resourcePath)) {
                        return false;
                    }

                    return true;
                },
            },
        },
    ],
},

@bingDBdu
Copy link

bingDBdu commented Jan 5, 2024

Solution found. Closing the issue.

Solution

  1. Create a .env file in the same directory where your package.json is
  2. Define the following variable GENERATE_SOURCEMAP=false as suggested by @d8corp

Thanks @d8corp and @nazebzurati

it works. But I'm not too fond of the way to fix the problem. it made me add another file named .env. How can I explain it to my colleagues or follows? it's only to fix the problem. I have to write it down in my project README to make sure it can be understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests