Create a new CRA application with react-scripts@5 and typescript
npx create-react-app --template=typescript .
Add react-json-to-table and use it.
Run yarn start and you will get this showing as error:
WARNING in ./node_modules/react-json-to-table/build/lib/components/JsonToTable/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/djohnston/git/repros/json-to-table-issue/node_modules/react-json-to-table/src/components/JsonToTable/index.ts' file: Error: ENOENT: no such file or directory, open '/home/djohnston/git/repros/json-to-table-issue/node_modules/react-json-to-table/src/components/JsonToTable/index.ts'
@ ./node_modules/react-json-to-table/build/lib/components/index.js 10:20-44
@ ./src/App.tsx 7:0-50 35:37-48
@ ./src/index.tsx 7:0-24 11:33-36
WARNING in ./node_modules/react-json-to-table/build/lib/components/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/djohnston/git/repros/json-to-table-issue/node_modules/react-json-to-table/src/components/index.tsx' file: Error: ENOENT: no such file or directory, open '/home/djohnston/git/repros/json-to-table-issue/node_modules/react-json-to-table/src/components/index.tsx'
@ ./src/App.tsx 7:0-50 35:37-48
@ ./src/index.tsx 7:0-24 11:33-36
Note that you do not get this warning/error when running yarn build.
I'm using react-json-to-table@0.1.17 - if we look at the package.json:
The reproduction steps are:
Add react-json-to-table and use it.
Run yarn start and you will get this showing as error:
Note that you do not get this warning/error when running yarn build.
I'm using react-json-to-table@0.1.17 - if we look at the package.json:
The package.json clearly marks where the package entry point and types are.
I believe the issue is with those source maps.
ie. index.js.map
I believe that the source map loader is looking at this source map file, and then warning that it can't find
"../../../src/components/index.tsx"
.Should the source maps be excluded from the artefact?
I think I recommend either:
(Somebody correct me if I'm wrong, I'm not especially familiar with using/configuring source maps).