Open danivegamx opened 1 year ago
Doing some workarounds, I was able to run without webpack version errors but the adapter is not working at all. Renderer shows multiple errors like:
┏ Renderer -------------------
<w> [webpack-dev-server] "hot: true" automatically applies HMR plugin, you don't have to add it manually to your webpack configuration.
┗ ----------------------------
┏ Renderer -------------------
(node:73508) [DEP_WEBPACK_CONFIGURATION_OPTIMIZATION_NO_EMIT_ON_ERRORS] DeprecationWarning: optimization.noEmitOnErrors is deprecated in favor of optimization.emitOnErrors
(Use `node --trace-deprecation ...` to show where the warning was created)
┗ ----------------------------
┏ Renderer -------------------
(node:73508) [DEP_WEBPACK_MAIN_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: MainTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
┗ ----------------------------
┏ Renderer -------------------
(node:73508) [DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: ChunkTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
┗ ----------------------------
┏ Renderer -------------------
(node:73508) [DEP_WEBPACK_MAIN_TEMPLATE_HASH_FOR_CHUNK] DeprecationWarning: MainTemplate.hooks.hashForChunk is deprecated (use JavascriptModulesPlugin.getCompilationHooks().chunkHash instead)
┗ ----------------------------
┏ Renderer -------------------
<e> [webpack-dev-middleware] TypeError: utils_1.resolveEntryAsync is not a function
<e> at config.entry (/Users/danvega/Animus/mlf-app/node_modules/@expo/electron-adapter/src/Webpack.ts:71:29)
<e> at processTicksAndRejections (node:internal/process/task_queues:95:5)
┗ ----------------------------
┏ Renderer -------------------
<i> [webpack-dev-server] Project is running at:
┗ ----------------------------
┏ Renderer -------------------
<i> [webpack-dev-server] Loopback: http://localhost:9080/, http://[::1]:9080/
<i> [webpack-dev-server] Content not from webpack is served from '/Users/danvega/Animus/mlf-app/public' directory
┗ ----------------------------
after that, nothing happens
Summary
Running
yarn expo-electron start
as per this tutorial, a validation error in webpack config is happening. Specially with 'namedModules'. This is related to webpack version (tutorial has webpack 4) but there's some other version impacting this?Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 13.4 Shell: 5.9 - /bin/zsh Binaries: Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm Watchman: 2023.06.12.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.1 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild npmPackages: @expo/metro-config: ^0.7.1 => 0.7.1 @expo/webpack-config: ^18.0.4 => 18.1.0 expo: ~48.0.17 => 48.0.19 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.71.8 => 0.71.8 react-native-web: ~0.18.10 => 0.18.12 npmGlobalPackages: expo-cli: 6.3.9 Expo Workflow: managed
Please specify your device/emulator/simulator platform, model and version
Desktop
Error output
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
configuration.optimization has an unknown property 'namedModules'. These properties are valid: object { checkWasmTypes?, chunkIds?, concatenateModules?, emitOnErrors?, flagIncludedChunks?, innerGraph?, mangleExports?, mangleWasmImports?, mergeDuplicateChunks?, minimize?, minimizer?, moduleIds?, noEmitOnErrors?, nodeEnv?, portableRecords?, providedExports?, realContentHash?, removeAvailableModules?, removeEmptyChunks?, runtimeChunk?, sideEffects?, splitChunks?, usedExports? } -> Enables/Disables integrated optimizations. Did you mean optimization.moduleIds: "named" (BREAKING CHANGE since webpack 5)? at validate (/Users/danvega/Animus/mlf-app/node_modules/webpack/node_modules/schema-utils/dist/validate.js:191:11) at validateSchema (/Users/danvega/Animus/mlf-app/node_modules/webpack/lib/validateSchema.js:78:2) at create (/Users/danvega/Animus/mlf-app/node_modules/webpack/lib/webpack.js:121:24) at webpack (/Users/danvega/Animus/mlf-app/node_modules/webpack/lib/webpack.js:169:32) at f (/Users/danvega/Animus/mlf-app/node_modules/webpack/lib/index.js:74:16) at /Users/danvega/Animus/mlf-app/node_modules/electron-webpack/src/dev/dev-runner.ts:90:34 at new Promise ()
at DevRunner.startMainCompilation (/Users/danvega/Animus/mlf-app/node_modules/electron-webpack/src/dev/dev-runner.ts:89:11)
at async Promise.all (index 2)
at DevRunner.start (/Users/danvega/Animus/mlf-app/node_modules/electron-webpack/src/dev/dev-runner.ts:47:5)
at main (/Users/danvega/Animus/mlf-app/node_modules/electron-webpack/src/dev/dev-runner.ts:147:3) {
errors: [
{
keyword: 'additionalProperties',
dataPath: '.optimization',
schemaPath: '#/additionalProperties',
params: [Object],
message: 'should NOT have additional properties',
schema: false,
parentSchema: [Object],
data: [Object]
}
],
schema: {
definitions: {
Amd: [Object],
AmdContainer: [Object],
AssetFilterItemTypes: [Object],
AssetFilterTypes: [Object],
AssetGeneratorDataUrl: [Object],
AssetGeneratorDataUrlFunction: [Object],
AssetGeneratorDataUrlOptions: [Object],
AssetGeneratorOptions: [Object],
AssetInlineGeneratorOptions: [Object],
AssetModuleFilename: [Object],
AssetModuleOutputPath: [Object],
AssetParserDataUrlFunction: [Object],
AssetParserDataUrlOptions: [Object],
AssetParserOptions: [Object],
AssetResourceGeneratorOptions: [Object],
AuxiliaryComment: [Object],
Bail: [Object],
CacheOptions: [Object],
CacheOptionsNormalized: [Object],
Charset: [Object],
ChunkFilename: [Object],
ChunkFormat: [Object],
ChunkLoadTimeout: [Object],
ChunkLoading: [Object],
ChunkLoadingGlobal: [Object],
ChunkLoadingType: [Object],
Clean: [Object],
CleanOptions: [Object],
CompareBeforeEmit: [Object],
Context: [Object],
CrossOriginLoading: [Object],
CssChunkFilename: [Object],
CssExperimentOptions: [Object],
CssFilename: [Object],
CssGeneratorOptions: [Object],
CssParserOptions: [Object],
Dependencies: [Object],
DevServer: [Object],
DevTool: [Object],
DevtoolFallbackModuleFilenameTemplate: [Object],
DevtoolModuleFilenameTemplate: [Object],
DevtoolNamespace: [Object],
EmptyGeneratorOptions: [Object],
EmptyParserOptions: [Object],
EnabledChunkLoadingTypes: [Object],
EnabledLibraryTypes: [Object],
EnabledWasmLoadingTypes: [Object],
Entry: [Object],
EntryDescription: [Object],
EntryDescriptionNormalized: [Object],
EntryDynamic: [Object],
EntryDynamicNormalized: [Object],
EntryFilename: [Object],
EntryItem: [Object],
EntryNormalized: [Object],
EntryObject: [Object],
EntryRuntime: [Object],
EntryStatic: [Object],
EntryStaticNormalized: [Object],
EntryUnnamed: [Object],
Environment: [Object],
Experiments: [Object],
ExperimentsCommon: [Object],
ExperimentsNormalized: [Object],
Extends: [Object],
ExtendsItem: [Object],
ExternalItem: [Object],
ExternalItemFunctionData: [Object],
ExternalItemValue: [Object],
Externals: [Object],
ExternalsPresets: [Object],
ExternalsType: [Object],
Falsy: [Object],
FileCacheOptions: [Object],
Filename: [Object],
FilenameTemplate: [Object],
FilterItemTypes: [Object],
FilterTypes: [Object],
GeneratorOptionsByModuleType: [Object],
GlobalObject: [Object],
HashDigest: [Object],
HashDigestLength: [Object],
HashFunction: [Object],
HashSalt: [Object],
HotUpdateChunkFilename: [Object],
HotUpdateGlobal: [Object],
HotUpdateMainFilename: [Object],
HttpUriAllowedUris: [Object],
HttpUriOptions: [Object],
HttpUriOptionsAllowedUris: [Object],
IgnoreWarnings: [Object],
IgnoreWarningsNormalized: [Object],
Iife: [Object],
ImportFunctionName: [Object],
ImportMetaName: [Object],
InfrastructureLogging: [Object],
JavascriptParserOptions: [Object],
Layer: [Object],
LazyCompilationDefaultBackendOptions: [Object],
LazyCompilationOptions: [Object],
Library: [Object],
LibraryCustomUmdCommentObject: [Object],
LibraryCustomUmdObject: [Object],
LibraryExport: [Object],
LibraryName: [Object],
LibraryOptions: [Object],
LibraryType: [Object],
Loader: [Object],
MemoryCacheOptions: [Object],
Mode: [Object],
ModuleFilterItemTypes: [Object],
ModuleFilterTypes: [Object],
ModuleOptions: [Object],
ModuleOptionsNormalized: [Object],
Name: [Object],
NoParse: [Object],
Node: [Object],
NodeOptions: [Object],
Optimization: [Object],
OptimizationRuntimeChunk: [Object],
OptimizationRuntimeChunkNormalized: [Object],
OptimizationSplitChunksCacheGroup: [Object],
OptimizationSplitChunksGetCacheGroups: [Object],
OptimizationSplitChunksOptions: [Object],
OptimizationSplitChunksSizes: [Object],
Output: [Object],
OutputModule: [Object],
OutputNormalized: [Object],
Parallelism: [Object],
ParserOptionsByModuleType: [Object],
Path: [Object],
Pathinfo: [Object],
Performance: [Object],
PerformanceOptions: [Object],
Plugins: [Object],
Profile: [Object],
PublicPath: [Object],
RawPublicPath: [Object],
RecordsInputPath: [Object],
RecordsOutputPath: [Object],
RecordsPath: [Object],
Resolve: [Object],
ResolveAlias: [Object],
ResolveLoader: [Object],
ResolveOptions: [Object],
ResolvePluginInstance: [Object],
RuleSetCondition: [Object],
RuleSetConditionAbsolute: [Object],
RuleSetConditionOrConditions: [Object],
RuleSetConditionOrConditionsAbsolute: [Object],
RuleSetConditions: [Object],
RuleSetConditionsAbsolute: [Object],
RuleSetLoader: [Object],
RuleSetLoaderOptions: [Object],
RuleSetLogicalConditions: [Object],
RuleSetLogicalConditionsAbsolute: [Object],
RuleSetRule: [Object],
RuleSetRules: [Object],
RuleSetUse: [Object],
RuleSetUseItem: [Object],
ScriptType: [Object],
SnapshotOptions: [Object],
SourceMapFilename: [Object],
SourcePrefix: [Object],
StatsOptions: [Object],
StatsValue: [Object],
StrictModuleErrorHandling: [Object],
StrictModuleExceptionHandling: [Object],
Target: [Object],
TrustedTypes: [Object],
UmdNamedDefine: [Object],
UniqueName: [Object],
WarningFilterItemTypes: [Object],
WarningFilterTypes: [Object],
WasmLoading: [Object],
WasmLoadingType: [Object],
Watch: [Object],
WatchOptions: [Object],
WebassemblyModuleFilename: [Object],
WebpackOptionsNormalized: [Object],
WebpackPluginFunction: [Object],
WebpackPluginInstance: [Object],
WorkerPublicPath: [Object]
},
title: 'WebpackOptions',
description: 'Options object as provided by the user.',
type: 'object',
additionalProperties: false,
properties: {
amd: [Object],
bail: [Object],
cache: [Object],
context: [Object],
dependencies: [Object],
devServer: [Object],
devtool: [Object],
entry: [Object],
experiments: [Object],
extends: [Object],
externals: [Object],
externalsPresets: [Object],
externalsType: [Object],
ignoreWarnings: [Object],
infrastructureLogging: [Object],
loader: [Object],
mode: [Object],
module: [Object],
name: [Object],
node: [Object],
optimization: [Object],
output: [Object],
parallelism: [Object],
performance: [Object],
plugins: [Object],
profile: [Object],
recordsInputPath: [Object],
recordsOutputPath: [Object],
recordsPath: [Object],
resolve: [Object],
resolveLoader: [Object],
snapshot: [Object],
stats: [Object],
target: [Object],
watch: [Object],
watchOptions: [Object]
}
},
headerName: 'Webpack',
baseDataPath: 'configuration',
postFormatter: [Function: postFormatter]
}
┏ Renderer -------------------
/Users/danvega/Animus/mlf-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46 return func(...args); ^
TypeError: Class constructor ServeCommand cannot be invoked without 'new' at runWhenInstalled (/Users/danvega/Animus/mlf-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46:9) at promptForInstallation (/Users/danvega/Animus/mlf-app/node_modules/webpack-cli/bin/utils/prompt-command.js:140:10) at /Users/danvega/Animus/mlf-app/node_modules/webpack-cli/bin/cli.js:32:43 at Object. (/Users/danvega/Animus/mlf-app/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
Node.js v18.16.0
┗ ---------------------------- Renderer WDS exited with code 1
Reproducible demo or steps to reproduce from a blank project
Using existing expo project with no expo-electron configuration or using a new expo project (using expo init)
yarn add -D @expo/electron-adapter
yarn expo-electron
should see the output