the-bugging / react-use-hotjar

Adds Hotjar capabilities as custom hooks such as init, identify and stateChange
https://www.npmjs.com/package/react-use-hotjar
MIT License
32 stars 6 forks source link

Broken sourcemaps add noise to create-react-app v5 output #15

Closed vith closed 2 years ago

vith commented 2 years ago

Describe the bug

Broken sourcemaps add noise to create-react-app v5 output:

Compiled with warnings.

Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts'

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

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

assets by status 9.52 KiB [cached] 2 assets
assets by status 1.49 MiB [emitted]
  assets by chunk 1.49 MiB (name: main)
    asset static/js/bundle.js 1.48 MiB [emitted] (name: main) 1 related asset
    asset main.77f586b74a9aca0e9655.hot-update.js 4.58 KiB [emitted] [immutable] [hmr] (name: main) 1 related asset
  assets by path *.json 699 bytes
    asset asset-manifest.json 671 bytes [emitted]
    asset main.77f586b74a9aca0e9655.hot-update.json 28 bytes [emitted] [immutable] [hmr]
  asset index.html 1.67 KiB [emitted]
Entrypoint main 1.49 MiB (1.51 MiB) = static/js/bundle.js 1.48 MiB main.77f586b74a9aca0e9655.hot-update.js 4.58 KiB 3 auxiliary assets
cached modules 1.37 MiB [cached] 107 modules
runtime modules 31.4 KiB 15 modules
./src/App.js 2.68 KiB [built] [code generated]

WARNING in ./node_modules/react-use-hotjar/dist/index.es.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts'
 @ ./src/App.js 8:0-41 14:2-11 63:10-19
 @ ./src/index.js 7:0-24 11:33-36

WARNING in ./node_modules/react-use-hotjar/dist/index.es.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts'
 @ ./src/App.js 8:0-41 14:2-11 63:10-19
 @ ./src/index.js 7:0-24 11:33-36

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

webpack 5.69.0 compiled with 2 warnings in 136 ms

To Reproduce Steps to reproduce the behavior:

  1. npx create-react-app cra-use-hotjar
  2. cd cra-use-hotjar
  3. npm i react-use-hotjar
  4. add useHotjar() to src/App.js
  5. npm start

Additional context https://github.com/facebook/create-react-app/discussions/11767#discussioncomment-1969071

olavoparno commented 2 years ago

@vith thank you for opening this issue! I will look into it as soon as possible.

olavoparno commented 2 years ago

@vith could you please try version 1.2.1? I temporarily removed sourcemap generation, I could not figure it out why the path is not being transpiled to build code so I just removed it so that you have a clean run.

olavoparno commented 2 years ago

@all-contributors please add @vith for bug

allcontributors[bot] commented 2 years ago

@olavoparno

I've put up a pull request to add @vith! :tada:

vith commented 2 years ago

@olavoparno no more warnings with 1.2.1, thanks!

olavoparno commented 2 years ago

Thanks for the reply, @vith ! Have a good one!