repack
repack copied to clipboard
Get error when bundling the app
Environment
"dependencies": { "@callstack/repack": "^2.4.2", "@react-native-async-storage/async-storage": "^1.15.9", "react": "17.0.1", "react-native": "0.64.2" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "babel-loader": "^8.2.3", "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.64.0", "react-test-renderer": "17.0.1", "terser-webpack-plugin": "^5.1.3", "webpack": "^5.50.0" },
Description
When I run "npx react-native webpack-bundle", I get the error:
error The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:329:5)
at validateString (node:internal/validators:129:11)
at Object.isAbsolute (node:path:1070:5)
at Object.getEntry (/Users/mac/Documents/Code/DemoMiniApps/node_modules/@callstack/repack/dist/webpack/utils/env/getEntry.js:29:26)
at Object.
When I run "PLATFORM=ios npx webpack-cli -c webpack.config.js", I get the error:
Running...[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
at Function.getCompilationHooks (/Users/mac/Documents/Code/DemoMiniApps/node_modules/webpack/lib/NormalModule.js:207:10)
at /Users/mac/Documents/Code/DemoMiniApps/node_modules/webpack/lib/HotModuleReplacementPlugin.js:765:18
at Hook.eval [as call] (eval at create (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/tapable/lib/HookCodeFactory.js:19:10),
When I run "npx react-native webpack-bundle", I get the error:
error The "path" argument must be of type string. Received undefined
You're missing --platform
, --entry-file
and --bundle-output
options. You need to pass the same options as you would pass to react-native bundle
.
When I run "PLATFORM=ios npx webpack-cli -c webpack.config.js", I get the error: Running...[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
You have multiple incompatible versions of Webpack:
-
/Users/mac/Documents/Code/DemoMiniApps/node_modules/webpack
-
/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/webpack
I suggest to remove the global one.
Looks like the issue was resolved, closing due to inactivity.
I am using following command
npx react-native webpack-bundle --platform ios --entry-file index.js --bundle-output dist/bundle.js
but still getting the above error.
TypeError: The "path" argument must be of type string. Received undefined at new NodeError (node:internal/errors:405:5) at validateString (node:internal/validators:162:11) at Object.join (node:path:1175:7) at AssetsCopyProcessor.enqueueChunk (/Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/@callstack/repack/dist/webpack/plugins/utils/AssetsCopyProcessor.js:49:70) at /Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/@callstack/repack/dist/webpack/plugins/OutputPlugin.js:225:55 at Hook.eval [as callAsync] (eval at create (/Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:17) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/tapable/lib/Hook.js:18:14) at /Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/webpack/lib/Compiler.js:882:27 at /Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/neo-async/async.js:2818:7 at done (/Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/neo-async/async.js:3522:9) at alreadyWritten (/Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/webpack/lib/Compiler.js:714:8) at /Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/webpack/lib/Compiler.js:802:19 at /Users/shivsharma/rn-micro-frontend-boilerplate/rn-mini-app-two/node_modules/graceful-fs/graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) { code: 'ERR_INVALID_ARG_TYPE' }
Hey @shivdotpy,
what version of RePack are you using? We've fixed this a while back.
hi @jbroma , where can we have a full tuto of react native RePack full deploy process???
@heradonbenin please create a seperate issue and describe your problem in detail.
@heradonbenin please create a seperate issue and describe your problem in detail.
@jbroma new issue created : https://github.com/callstack/repack/issues/490