Skip to content

[Bug] Published npm package missing src/ files referenced by source maps, causing build warnings #568

@willresen

Description

@willresen

Expected behaviour

The @highcharts/react npm package should either:

include the src/ directory referenced by its .js.map files, or
omit source map files from the published package if sources are not shipped

Actual behaviour

Every .js.map file in the published package (e.g. Highcharts.js.map, options/YAxis.js.map, options/index.js.map) references source files under a src/ directory (e.g. src/Highcharts.tsx, src/options/YAxis.tsx) that are not present in the published package. This causes source-map-loader to emit warnings for every file during webpack builds:

WARNING in ../../node_modules/@highcharts/react/options/YAxis.js Module Warning (from source-map-loader): Failed to parse source map from '...\node_modules\@highcharts\react\src\options\YAxis.tsx' file: Error: ENOENT: no such file or directory

Live demo with steps to reproduce

  1. npm install @highcharts/react
  2. Import and use any component from @highcharts/react in a webpack-based project (e.g. Create React App / CRACO)
  3. Run the development build
  4. Observe source-map-loader warnings for every file in the package

Product version

v4.2.1

Affected browser(s)

Build-time only

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions