ipikuka / remark-flexible-markers

Remark plugin to add custom mark element with customizable properties in markdown
MIT License
10 stars 0 forks source link

[Webpack Warning] Failed to parse source map #1

Closed alex-titarenko closed 1 year ago

alex-titarenko commented 1 year ago

When using the plugin with Create React App it throws the following error

WARNING in ./node_modules/remark-flexible-markers/dist/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/<redacted>/node_modules/remark-flexible-markers/src/index.ts' file: Error: ENOENT: no such file or directory, open '/<redacted>/node_modules/remark-flexible-markers/src/index.ts'

webpack compiled with 1 warning

Anyway, thank you for the excellent project.

talatkuyuk commented 1 year ago

Thank you @alex-titarenko for reporting the issue.

Actually I checked all other remark plugins in the node_modules, I see that there is no source map files nor src folder that contains .ts files. I suppose you get the same warnings for the other remark plugins.

I may include sourceMap: true in the typescript config file and files: [..., "src"] in the package.json in order to include source map file and the typescript files, but I don't want to increase the package size for now.

You can disable the warning for the source-map-loader in the create-react-app configuration, if you want: https://github.com/webpack-contrib/source-map-loader#ignoring-warnings

alex-titarenko commented 1 year ago

@talatkuyuk thank you for your response. I don't understand why you worry about package size, the source map usually is not included in production builds and if they are, they shipped as separate files and it should not impact end-user project bandle size. Also, source maps are useful anyway for developers. Otherwise, many of your customers will experience the issue I faced.

talatkuyuk commented 1 year ago

I have published the version 1.0.3 for supporting source map. Can you try it ?

alex-titarenko commented 1 year ago

Hi @talatkuyuk your fix works as intended. Thank you so much :)