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

[ui5-tooling-modules] Third party library added to Fiori UI application is failing to load #927

Closed
longieirl opened this issue Dec 15, 2023 · 3 comments · Fixed by #929
Closed
Assignees

Comments

@longieirl
Copy link

Describe the bug
Appending ui5-tooling-modules to an existing Fiori UI application fails to load the third party module. Downgrading to v3.2.4 works fine.

To Reproduce
Down sample project in the following PR which has a hardcode dependency of version v3.2.4
SAP-samples/fiori-tools-samples#36

Project dependencies are listed as;

    "dependencies": {
        "ui5-tooling-modules": "3.2.5",
        "xml-js": "^1.6.11"
    },
    "devDependencies": {
        "@sap-ux/ui5-middleware-fe-mockserver": "2",
        "@sap/ui5-builder-webide-extension": "^1.1.8",
        "@sap/ux-ui5-tooling": "1",
        "@ui5/cli": "^3.0.0",
        "mbt": "^1.2.18",
        "ui5-task-zipper": "^0.5.0"
    },

The project is a created as a Fiori UI Freestyle application. Using the following commands, the UI app fails to load

npm run start

or

npm run start-noflp

Expected behavior
Project is loaded and third party library is consumed.

Actual behavior
Console log is showing an exception and the UI app fails to load the third party module.

The following exception is thrown;

Uncaught (in promise) ModuleError: Failed to resolve dependencies of 'ztest/docapp1/ztravel/controller/View1.controller.js'
 -> 'xml-js.js': failed to execute module factory for ''xml-js.js'': exports is not defined
    at ye (http://localhost:8080/resources/sap-ui-core.js:10:7867)
    at pe.failWith (http://localhost:8080/resources/sap-ui-core.js:10:5704)
    at http://localhost:8080/resources/sap-ui-core.js:10:18086
Caused by: ModuleError: failed to execute module factory for ''xml-js.js'': exports is not defined
    at ye (http://localhost:8080/resources/sap-ui-core.js:10:7867)
    at pe.failWith (http://localhost:8080/resources/sap-ui-core.js:10:5704)
    at d (http://localhost:8080/resources/sap-ui-core.js:10:17729)
Caused by: ReferenceError: exports is not defined
    at http://localhost:8080/resources/xml-js.js:3571:38
    at d (http://localhost:8080/resources/sap-ui-core.js:10:17556)

Desktop (please complete the following information):

  • OS - Mac
  • Browser - latest chrome
  • Version v120

Additional context
Add any other context about the problem here.

@longieirl longieirl changed the title Third party library added to Fiori UI application is failing to load [ui5-tooling-modules] Third party library added to Fiori UI application is failing to load Dec 15, 2023
@petermuessig
Copy link
Member

Hi @longieirl ,

since the version upgrade of the 3rd party dependencies from rollup, there are some issue how the 3rd party models are exported. I hope I find a solution soon...

@petermuessig petermuessig self-assigned this Dec 17, 2023
petermuessig added a commit that referenced this issue Dec 19, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
@petermuessig
Copy link
Member

Related to #915

petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
Fixes #915
petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
Fixes #915
petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
Fixes #915
petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
Fixes #915
petermuessig added a commit that referenced this issue Dec 25, 2023
The packaging of npm packages resolves the browser modules also from
the exports section of the package.json. This provides a better
coverage to detect the browser modules inside the npm packages.

In addition, this fix also allows to add polyfill overrides in the
current working directory.

Fixes #927
Fixes #915
@petermuessig
Copy link
Member

ui5-tooling-modules version 3.2.6 should fix the issue!

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

Successfully merging a pull request may close this issue.

2 participants