schoero / swissqrbill

Swiss QR Bill generation in Node.js and browsers
MIT License
156 stars 29 forks source link

Module collapses under react-scripts 5.0.1 with webpack 5. #378

Closed darobbo closed 2 years ago

darobbo commented 2 years ago

I used this library with react-scripts 3.4.4 and it was perfect. I had to update to react-scripts 5.0.1 because of security issues. This new version uses webpack 5 and messed up lot of my codes and dependencies ()mostly using react-app-rewired). I could fix all of them, except these libraries.

Now when I start react, I get the following errors: `Compiled with warnings.

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/instance/SVGInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/instance/SVGInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/utils/createElement.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/utils/createElement.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/index.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/calc.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/calc.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/svg.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGCircleInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGCircleInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGDefsInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGDefsInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGGroupInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGGroupInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLineInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLineInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLinearGradientInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLinearGradientInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGPathInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGPathInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGRectInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGRectInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGSVGInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGSVGInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGStopInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGStopInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTSpanInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTSpanInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTextInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTextInstance.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/cxcyPositioning.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/cxcyPositioning.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/preserveAspectRatio.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/preserveAspectRatio.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/text.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/text.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/widthHeight.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/widthHeight.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/xyPositioning.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/xyPositioning.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/index.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/descriptiveInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/descriptiveInstances.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientInstances.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientStopInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientStopInstances.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/shapeInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/shapeInstances.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/structuralInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/structuralInstances.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/color.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/color.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/display.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/display.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/fill.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/fill.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/opacity.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/opacity.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/stroke.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/stroke.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/vectorEffect.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/vectorEffect.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/visibility.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/visibility.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/style-attributes/font.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/style-attributes/font.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/utils/functions.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/utils/functions.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/index.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/pdf.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/svg.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/extended-pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/extended-pdf.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/pdf.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code-generator.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code-generator.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/shared.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/shared.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/translations.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/translations.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/types.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/types.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/utils.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/utils.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/characterWidth.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/characterWidth.ts'

Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/svg.ts'

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

WARNING in ./node_modules/svg-engine/lib/browser/esm/browser/instance/SVGInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/instance/SVGInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/instance/SVGInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/browser/utils/createElement.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/utils/createElement.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/browser/utils/createElement.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/index.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/index.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/exports/calc.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/calc.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/calc.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/exports/svg.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/exports/svg.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGCircleInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGCircleInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGCircleInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGDefsInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGDefsInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGDefsInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGGroupInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGGroupInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGGroupInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGLineInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLineInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLineInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGLinearGradientInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLinearGradientInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGLinearGradientInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGPathInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGPathInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGPathInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGRectInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGRectInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGRectInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGSVGInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGSVGInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGSVGInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGStopInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGStopInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGStopInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGTSpanInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTSpanInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTSpanInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/instances/SVGTextInstance.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTextInstance.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/instances/SVGTextInstance.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/attributes/cxcyPositioning.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/cxcyPositioning.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/cxcyPositioning.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/attributes/preserveAspectRatio.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/preserveAspectRatio.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/preserveAspectRatio.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/attributes/text.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/text.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/text.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/attributes/widthHeight.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/widthHeight.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/widthHeight.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/attributes/xyPositioning.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/xyPositioning.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/attributes/xyPositioning.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/index.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/index.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/permitted-content/descriptiveInstances.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/descriptiveInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/descriptiveInstances.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/permitted-content/gradientInstances.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientInstances.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/permitted-content/gradientStopInstances.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientStopInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/gradientStopInstances.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/permitted-content/shapeInstances.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/shapeInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/shapeInstances.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/permitted-content/structuralInstances.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/structuralInstances.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/permitted-content/structuralInstances.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/color.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/color.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/color.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/display.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/display.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/display.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/fill.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/fill.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/fill.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/opacity.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/opacity.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/opacity.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/stroke.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/stroke.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/stroke.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/vectorEffect.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/vectorEffect.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/vectorEffect.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/presentation-attributes/visibility.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/visibility.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/presentation-attributes/visibility.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/mixins/style-attributes/font.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/style-attributes/font.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/mixins/style-attributes/font.ts'

WARNING in ./node_modules/svg-engine/lib/browser/esm/shared/utils/functions.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/utils/functions.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/svg-engine/src/shared/utils/functions.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/browser/index.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/index.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/browser/pdf.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/pdf.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/browser/svg.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/browser/svg.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/pdf/extended-pdf.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/extended-pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/extended-pdf.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/pdf/pdf.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/pdf.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/pdf/pdf.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/qr-code-generator.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code-generator.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code-generator.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/qr-code.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/qr-code.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/shared.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/shared.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/shared.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/translations.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/translations.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/translations.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/types.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/types.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/types.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/shared/utils.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/utils.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/shared/utils.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/svg/characterWidth.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/characterWidth.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/characterWidth.ts'

WARNING in ./node_modules/swissqrbill/lib/browser/esm/svg/svg.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/svg.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/Documents/xyz-webapp/xyz-ch-frontend/node_modules/swissqrbill/src/svg/svg.ts'

webpack compiled with 49 warnings

`

I would appreciate any help.

Thanks

darobbo commented 2 years ago

This is what I get runtime image

I do nothing fancy just this: const pdf = new PDF(data, stream, { autoGenerate: false, size: "A4", scissors: true, language: getLanguage() });

schoero commented 2 years ago

What version of SwissQRBill are you using? I think there might be a problem with your webpack config. A webpack 5 compatible config can be found here.

Do you mind posting your webpack config?

darobbo commented 2 years ago

What version of SwissQRBill are you using? I think there might be a problem with your webpack config. A webpack 5 compatible config can be found here.

Do you mind posting your webpack config?

I use react-rewired, my config-overrides.js looks like this (I didn't touch the webpack config and I don't want to):

const webpack = require("webpack") module.exports = function override(config, env) { //do stuff with the webpack config... config.resolve.fallback = { ...config.resolve.fallback, fs: false, tls: false, net: false, http: require.resolve("stream-http"), https: false, zlib: require.resolve("browserify-zlib") , path: require.resolve("path-browserify"), stream: require.resolve("stream-browserify"), crypto: require.resolve("crypto-browserify"), buffer: require.resolve("buffer"), } config.resolve.extensions = [...config.resolve.extensions, ".ts", ".js"] config.plugins = [ ...config.plugins, new webpack.ProvidePlugin({ process: "process/browser", Buffer: ["buffer", "Buffer"], }), ] return config }

schoero commented 2 years ago

Did you also update from SwissQRBill v2.x to v3.x? I'm asking because in v2.x SwissQRBill used a prebundled version of PDFKit. If you don't want to deal with the webpack config, you are still able to include the prebundled version the module using an import like this:

import { PDF } from "swissqrbill/lib/browser/bundle/index.js";

Your runtime error also indicates that something with the webpack config is wrong. Unfortunately it is quite complicated to get the config running. You should try to incorporate the config that i have linked into your config-overrides.js

You can find a bit more information about this on the PDFKit repo

darobbo commented 2 years ago

The import you suggested + the config-overrides.js I posted solved the issue. Thank you.

Please note that I still get the warnings I originally posted but it doesn't prevent the code to run.