Skip to content

Uncaught SyntaxError: Identifier 'chrome' has already been declared #4978

Closed

Description

@rpsirois

Bug Description

When importing any web component from @ui5/webcomponents (version 1.2.3), I get the following error:

Uncaught SyntaxError: Identifier 'chrome' has already been declared

Expected Behavior

No errors.

Steps to Reproduce

import '@ui5/webcomponents/dist/Button.js'

Isolated Example

Playgrounds in documentation are not working.

Context

  • UI5 Web Components version: 1.2.3
  • OS/Platform: popOS
  • Browser: Chrome
  • Affected component: Button and Input so far

Log Output / Stack Trace / Screenshots

Priority

  • Low
  • Medium
  • High
  • Very High

Stakeholder Info (if applicable)

  • Currently evaluating for use in business applications

Thank you in advance.

Activity

  1. ilhan007 commented on Mar 29, 2022

    @ilhan007
    Contributor

    Hello @rpsirois
    thank you for your interest in using the UI5 Web Components.

    Here you can see a code sample importing the Button in version 1.2.3 - I don't get the described error:
    https://codesandbox.io/s/ui5-webcomponents-forked-e2ipfr?file=/index.html
    You can edit the sample and if you reproduce the error you can get back to us.
    Or, perhaps add more information on how to reproduce it - you can also contact me offline.
    If it is ok, can you share with us the Business app you might use the components for?

    Best Regards,
    ilhan M.
    UI5 Web Components Team

  2. self-assigned this
    on Mar 29, 2022
  3. rpsirois commented on Mar 30, 2022

    @rpsirois
    Author

    My apologies. It turns out it is something Rollup is doing. If I go into the built esm file, I can rename chrome to something else, then it all works just fine. I just hadn't run into this evaluating other WC libraries, so I figured UI5 must be declaring chrome somewhere as well where it conflicted.

    Thanks for the assistance. I was able to use your Code Sandbox to recreate the issue using a Rollup build instead of Parcel.

  4. wesleyyee commented on Jan 20, 2023

    @wesleyyee

    @rpsirois what did you end up doing to fix the issue?

  5. rpsirois commented on Jan 20, 2023

    @rpsirois
    Author

    I didn't end up looking into it further because we chose not to use these UI components. Sorry I can't shed more light on that new issue. It's been a lay-off and almost a year since I was working on this.

  6. pskelin commented on Feb 9, 2023

    @pskelin
    Contributor

    this could be due to multiple instances of ui5-webcomponents installed in node_modules. you can check with
    npm ls @ui5/webcomponents or yarn why @ui5/webcomponents to see if this is the case and try to remove one of them.

    another thing that could help is to delete node_modules and do a new npm install or yarn install.

    this is all I can say without a reproducible issue.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions