Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error when bundling the app #127

Closed
daiquangduy opened this issue Oct 26, 2021 · 7 comments
Closed

Get error when bundling the app #127

daiquangduy opened this issue Oct 26, 2021 · 7 comments
Labels
status:stale Missing feedback or response for prolonged period of time.

Comments

@daiquangduy
Copy link

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. (/Users/mac/Documents/Code/DemoMiniApps/webpack.config.js:37:27)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)

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), :106:1)
at Hook.CALL_DELEGATE [as _call] (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/tapable/lib/Hook.js:14:14)
at Compiler.newCompilation (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/webpack/lib/Compiler.js:1053:26)
at /Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/webpack/lib/Compiler.js:1097:29
at Hook.eval [as callAsync] (eval at create (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.compile (/Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/webpack/lib/Compiler.js:1092:28)
at /Users/mac/.npm/_npx/73f0de3f6fbaf968/node_modules/webpack/lib/Compiler.js:517:12

@zamotany
Copy link
Contributor

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.

@zamotany zamotany added the status:stale Missing feedback or response for prolonged period of time. label Dec 20, 2021
@RafikiTiki
Copy link
Member

Looks like the issue was resolved, closing due to inactivity.

@shivdotpy
Copy link

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' }

@jbroma
Copy link
Member

jbroma commented Aug 11, 2023

Hey @shivdotpy,

what version of RePack are you using? We've fixed this a while back.

@heradonbenin
Copy link

hi @jbroma , where can we have a full tuto of react native RePack full deploy process???

@jbroma
Copy link
Member

jbroma commented Jan 29, 2024

@heradonbenin please create a seperate issue and describe your problem in detail.

@heradonbenin
Copy link

@heradonbenin please create a seperate issue and describe your problem in detail.

@jbroma new issue created : #490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:stale Missing feedback or response for prolonged period of time.
Projects
None yet
Development

No branches or pull requests

6 participants