diff2html icon indicating copy to clipboard operation
diff2html copied to clipboard

Failed to parse source map

Open sewolf opened this issue 3 years ago • 6 comments

Step 0: Describe your environment

  • OS: macOS 12.4
  • diff2html version: 3.4.17

Step 1: Describe the problem:

the webpack dev server returns compile warnings

Observed Results:

Compiled with 11 warnings.

Failed to parse source map from '/Users/sewolf/workspace/myproject/node_modules/diff2html/src/diff-parser.ts' file: Error: ENOENT: no such file or directory, open '/Users/sewolf/workspace/myproject/node_modules/diff2html/src/diff-parser.ts'

sewolf avatar Jun 02 '22 11:06 sewolf

It is very hard to understand what is happening, in what context did this happen? What versions of node etc were you running?

rtfpessoa avatar Jun 03 '22 21:06 rtfpessoa

i hava a typescript project created with create-react-app and installed diff2html v. 3.4.17 (node v18.3.0). When i start the development server with "npm run start" the i see this warnings.

sewolf avatar Jun 21 '22 08:06 sewolf

👋 Version 3.4.17 does not exist, can you double check that? Also, can you provide maybe a snippet or a script to replicate the error?

rtfpessoa avatar Jun 24 '22 20:06 rtfpessoa

here is also the 3.4.17 version https://www.npmjs.com/package/diff2html/v/3.4.17

test project: https://github.com/sewolf/diff2html-app

console output after npm run start:

WARNING in ./node_modules/diff2html/lib-esm/diff-parser.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff-parser.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff-parser.ts'

WARNING in ./node_modules/diff2html/lib-esm/diff2html-templates.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff2html-templates.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff2html-templates.ts'

WARNING in ./node_modules/diff2html/lib-esm/diff2html.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff2html.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/diff2html.ts'

WARNING in ./node_modules/diff2html/lib-esm/file-list-renderer.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/file-list-renderer.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/file-list-renderer.ts'

WARNING in ./node_modules/diff2html/lib-esm/hoganjs-utils.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/hoganjs-utils.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/hoganjs-utils.ts'

WARNING in ./node_modules/diff2html/lib-esm/line-by-line-renderer.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/line-by-line-renderer.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/line-by-line-renderer.ts'

WARNING in ./node_modules/diff2html/lib-esm/rematch.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/rematch.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/rematch.ts'

WARNING in ./node_modules/diff2html/lib-esm/render-utils.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/render-utils.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/render-utils.ts'

WARNING in ./node_modules/diff2html/lib-esm/side-by-side-renderer.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/side-by-side-renderer.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/side-by-side-renderer.ts'

WARNING in ./node_modules/diff2html/lib-esm/types.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/types.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/types.ts'

WARNING in ./node_modules/diff2html/lib-esm/utils.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/private/tmp/diff2html-app-main/node_modules/diff2html/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/private/tmp/diff2html-app-main/node_modules/diff2html/src/utils.ts'

sewolf avatar Jun 24 '22 22:06 sewolf

So seems like it does not fail. It just throws warnings. I have no idea why it is looking for source maps or even how to generate them.

I am just using regular webpack to build the project. If you know how to fix this let me know. But honestly not sure why it would show warnings if they do not exist.

rtfpessoa avatar Jun 27 '22 19:06 rtfpessoa

here is the same problem described: https://stackoverflow.com/questions/70599784/failed-to-parse-source-map i have also added GENERATE_SOURCEMAP=false in .env file to remove this warnings

sewolf avatar Jun 28 '22 08:06 sewolf

Closing for inactivity.

rtfpessoa avatar Aug 07 '23 14:08 rtfpessoa