Skip to content

Question about "return config?. registry" . #1

Description

@mdxiaohu
./node_modules/@basd/registry/lib/registry.js 125:18
Module parse failed: Unexpected token (125:18)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. 
See https://webpack.js.org/concepts#loaders

After downloading the plugin normally, an error will be reported .

 static get(config) {
    if (config instanceof this) return config
    return config?.registry instanceof this ? config.registry : new this(config)
  }

The reason lies in the use of '?.'

Maybe it could be changed to something like this

return config && config.registry instanceof this ? config.registry : new this(config);

Or there could be a better way .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions