Include src/ files in npm release (for resolving source maps)
See original GitHub issueIs your feature request related to a problem? Please describe.
I am using parcel to bundle a JS project using aws-amplify
and also aws-amplify-react
. When parcel loads the amplify libraries, it finds source maps, but then fails to find the related sources in the node_modules folder:
⚠️ Could not load source file “…/…/src/Providers/index.ts” in source map of “…/node_modules/@aws-amplify/interactions/lib/Providers/index.js”.
I checked the node_modules/@aws-amplify/
folder and all src/
directories are empty—I must assume the way the project is packaged excludes them.
Describe the solution you’d like
I would like for the src directories to be included in the npm package. This way my bundler can find the source files and give me better error messages if things break.
I think the bundler will successfully exclude those files when it builds the app from production too. So it shouldn’t be any additional file size load on the actual released app.
Describe alternatives you’ve considered
I see one other workaround that some people have turned off loading of source maps from their node_modules/ directory: https://github.com/aws-amplify/amplify-js/issues/433#issuecomment-372723436 , however, I think it would be more robust to include the sources for people who want them.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
@manueliglesias - I just submitted PR #2680 that should fix this problem by removing
src/**
from the.npmignore
file of 13 Amplify packages that previously had been omitting source code from npm.FYI @dabit3, @ArmorDarks, @roborourke, @mrcoles
FWIW, after I posted the comment above 10 days ago, I wasted 2 hours in the debugger trying to step-through the AWS client SDK code before I found the root cause in my code. It’s incredibly hard to step through transpiled async/await code without sourcemaps to help.