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

Failed to inspect file when trying to use a dependency from NPM #1110

Open
mauricioszabo opened this issue Apr 14, 2023 · 2 comments
Open

Failed to inspect file when trying to use a dependency from NPM #1110

mauricioszabo opened this issue Apr 14, 2023 · 2 comments

Comments

@mauricioszabo
Copy link

I had to use a NPM dependency that have the following code on it:

class GitHost {
  constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) {
    Object.assign(this, GitHost.#gitHosts[type], {
      type,
      user,
      auth,
      project,
      committish,
      default: defaultRepresentation,
      opts,
    })
  }

  static #gitHosts = { byShortcut: {}, byDomain: {} }
  ///...
}```

This, surprisingly, is valid Javascript code, but when I tried to add this dependency  to shadow-cljs (either by using `:target :browser` or by using `:js-options {:js-provider :shadow}`) the build fails with the message:

Failed to inspect file
/home/mauricio/...

it was required from
/home/mauricio/...

Errors encountered while trying to parse file
/home/mauricio/...
{:line ..., :message "'identifier' expected"}


The line and column match exactly the beginning of `.#gitHosts[type],`
@thheller
Copy link
Owner

This is not yet supported by the Closure Compiler I guess. You can use :js-provider :external if you must use this package. Otherwise we'll have to wait till the Closure Compiler implements it. Nothing I can do from the shadow-cljs side.

@thheller
Copy link
Owner

This is the related issue google/closure-compiler#2731. Still nothing though.

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

No branches or pull requests

2 participants