https://github.com/ronbraha/knip-expo-issue
Since version 5.42.0, Knip fails to run in an expo app with an app.config.js
that accepts a function with a config object.
The errors vary from version 5.42.0 to the latest (5.42.2), as there was an attempt to address this in the newest version.
This is what I see in 5.42.2 with a new app created with create-expo-app
, and I experience the same issue in a production app:
module.exports = ({ config }) => config;
^
TypeError: Cannot destructure property 'config' of 'undefined' as it is undefined.
at module.exports (/Users/ronbraha/Code/debugging/knip-issue/app.config.js:1:21)
at Object.resolveEntryPaths (file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/plugins/expo/index.js:12:60)
at runPlugin (file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/WorkspaceWorker.js:246:85)
at async WorkspaceWorker.findDependenciesByPlugins (file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/WorkspaceWorker.js:281:13)
at async main (file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/index.js:120:41)
at async run (file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/cli.js:26:83)
at async file:///Users/ronbraha/Code/debugging/knip-issue/node_modules/knip/dist/cli.js:104:1
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too