bjerkio/oidc-react

Source Maps produce build errors

TheDome opened this issue · 3 comments

Hi there,

I am using oidc-react in my react app and am amazed!
However a minor issue when building the app is when source-map-loader tries to resolve the source maps from the package, which are not delivered correctly and reference non-existant files.

One such message is:

WARNING in ./node_modules/oidc-react/build/src/AuthContext.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/app/node_modules/oidc-react/src/AuthContext.tsx' file: Error: ENOENT: no such file or directory, open '/app/node_modules/oidc-react/src/AuthContext.tsx'

WARNING in ./node_modules/oidc-react/build/src/AuthContextInterface.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/app/node_modules/oidc-react/src/AuthContextInterface.ts' file: Error: ENOENT: no such file or directory, open '/app/node_modules/oidc-react/src/AuthContextInterface.ts'

WARNING in ./node_modules/oidc-react/build/src/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/app/node_modules/oidc-react/src/index.ts' file: Error: ENOENT: no such file or directory, open '/app/node_modules/oidc-react/src/index.ts'

WARNING in ./node_modules/oidc-react/build/src/useAuth.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/app/node_modules/oidc-react/src/useAuth.ts' file: Error: ENOENT: no such file or directory, open '/app/node_modules/oidc-react/src/useAuth.ts'

WARNING in ./node_modules/oidc-react/build/src/withAuth.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/app/node_modules/oidc-react/src/withAuth.tsx' file: Error: ENOENT: no such file or directory, open '/app/node_modules/oidc-react/src/withAuth.tsx'

Since I am not a huge fan of error messages during development, which sometimes fuzz with my builds, I would propose to inline the source maps, so that the sources are available to react builds.

I have created a pull request to discuss these changes: #992

How is this now, @TheDome?

I do not receive any compilation errors anymore. So fixed this issue! :)
Sorry for not closing this. I though GH closes the issue automatically