Browse Source

Do not error if requiredVersion is not provided.

If a package overrides the sharing config for a dependency, it might have forgotton to give the requiredVersion (so requiredVersion is undefined). In this case, don't error, but instead just go with the default webpack behavior.
Jason Grout 4 years ago
parent
commit
5c9654f761
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dev_mode/webpack.config.js

+ 1 - 1
dev_mode/webpack.config.js

@@ -240,7 +240,7 @@ Object.assign(shared, mergedShare);
 // imported package. This assumes (for simplicity) that the version we get
 // importing was installed from the file.
 for (let [key, { requiredVersion }] of Object.entries(shared)) {
-  if (requiredVersion.startsWith('file:')) {
+  if (requiredVersion?.startsWith('file:')) {
     shared[key].requiredVersion = require(`${key}/package.json`).version;
   }
 }