#webpack #nativescript
#webpack #nativescript
Вопрос:
Я выполнил следующее ns migrate
в документации, чтобы обновить свое приложение, чтобы использовать последнюю версию NativeScript. Это удается
⚠ Git branch not clean, but using --force
✔ Pre-Migration verification complete
✔ Project files have been backed up
✔ Cleaned directory hooks
✔ Cleaned directory platforms
✔ Cleaned directory node_modules
✔ Cleaned file webpack.config.js
✔ Cleaned file package-lock.json
ℹ Skipping tsconfig.tns.json because it doesn't exist.
✔ Project files have been cleaned up
✔ Cleaned old artifacts
ℹ Skipping app/package.json because it doesn't exist.
ℹ Skipping nsconfig.json because it doesn't exist.
✔ Project has been migrated to use nativescript.config.ts
- nativescript-dev-webpack has been replaced with @nativescript/webpack v3.0.0
- nativescript-angular has been replaced with @nativescript/angular v10.0.0
✔ Project dependencies have been updated
✔ Updated tsconfig.json
✔ Migration complete.
Project has been successfully migrated. The next step is to run ns run <platform> to ensure everything is working properly.
Please note that ns migrate does not make changes to your source code, you may need additional changes to complete the migration
Это удалось, как показано выше. Я отмечаю, что nativescript-dev-webpack был заменен на @nativescript/webpack v3.0.0
Затем я запускаю ns run ios
и постоянно получаю следующую ошибку:
Platform ios successfully added. v7.0.0
Preparing project...
/Users/iosdev/appdir/node_modules/webpack-cli/bin/cli.js:93
throw err;
^
TypeError: host.onUnRecoverableConfigFileDiagnostic is not a function
at Object.getParsedCommandLineOfConfigFile (/Users/iosdev/appdir/node_modules/typescript/lib/typescript.js:27947:18)
at getCompilerOptionsFromTSConfig (/Users/iosdev/appdir/node_modules/@nativescript/webpack/utils/tsconfig-utils.js:14:25)
at getNoEmitOnErrorFromTSConfig (/Users/iosdev/appdir/node_modules/@nativescript/webpack/utils/tsconfig-utils.js:20:29)
at module.exports (/Users/iosdev/appdir/webpack.config.js:104:39)
at handleFunction (/Users/iosdev/appdir/node_modules/webpack-cli/bin/utils/prepareOptions.js:21:13)
at prepareOptions (/Users/iosdev/appdir/node_modules/webpack-cli/bin/utils/prepareOptions.js:9:5)
at requireConfig (/Users/iosdev/appdir/node_modules/webpack-cli/bin/utils/convert-argv.js:117:14)
at /Users/iosdev/appdir/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (/Users/iosdev/appdir/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
at /Users/iosdev/appdir/node_modules/webpack-cli/bin/cli.js:71:45
at Object.parse (/Users/iosdev/appdir/node_modules/yargs/yargs.js:576:18)
at /Users/iosdev/appdir/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/Users/iosdev/appdir/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/iosdev/appdir/node_modules/webpack/bin/webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Executing webpack failed with exit code 1.
Прочитав эту ошибку, я понимаю, что это может быть связано с обновлением webpack до версии 3.0.0, как упоминалось выше. Может кто-нибудь помочь мне расшифровать этот вывод журнала ошибок, поскольку я не смог найти аналогичную проблему в SO или в Интернете. Я просмотрел некоторые другие, у которых был такой же «Сбой при выполнении webpack с кодом выхода 1». но это не совсем соответствовало моему сценарию.
Спасибо!