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] failed to load JavaScript resource for jspdf #1128

Open
mmotkim opened this issue Dec 1, 2024 · 33 comments
Open

[ui5-tooling-modules] failed to load JavaScript resource for jspdf #1128

mmotkim opened this issue Dec 1, 2024 · 33 comments

Comments

@mmotkim
Copy link

mmotkim commented Dec 1, 2024

Describe the bug
I'm working on an adaptation project, I've been following the documentation on www.npmjs.com/package/ui5-tooling-modules and got the library excelJS to work. I cleared the excel-related code and proceeded to use jspdf when I could not get it to work.
I've tried tweaking witth skipTransform skipCache: true inject: and still to no avail,
interestingly I also can't get debug: true to work. It creates the same log whether I'm using npm run start or npm run build.
I've been scratching my head at this thing for 3 days now.
To Reproduce
Steps to reproduce the behavior:

  1. Create Adaptation Project from generator templates on vscode that connect to a sap system backend (uses fiori-tools-proxy)
  2. Configure according to www.npmjs.com/package/ui5-tooling-modules
  3. npm i jspdf
  4. Import jsPDF and Application Preview

Screenshots
Image
Image

Code
Here's my ui5.yaml:

# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json

specVersion: "3.0"
metadata:
  name: atpreportvariant
type: application
resources:
  configuration:
    propertiesFileSourceEncoding: UTF-8
customConfiguration:
  adp:
    support:
      id: "@sap/generator-adaptation-project"
      version: 1.1.63
      toolsId: 09edfc9e-5876-4488-a154-8d943eb1994e
  ui5-tooling-modules: &cfgModules
    skipCache: true
    skipTransform:
      - "@jspdf/dist/jspdf.es.*"
      - "@jspdf/dist/jspdf.node.*"
    debug: "true"
builder:
  customTasks:
    - name: ui5-tooling-modules-task
      afterTask: replaceVersion
      configuration:
        <<: *cfgModules
        debug: true
server:
  customMiddleware:
    - name: ui5-tooling-modules-middleware
      afterMiddleware: compression
      configuration:
        debug: true
        <<: *cfgModules
        inject:
          jsPDF: jspdf
    - name: fiori-tools-appreload
      afterMiddleware: ui5-tooling-modules-middleware
      configuration:
        port: 35729
        path: webapp
        delay: 300
    - name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        adp:
          target:
            client: "302"
            url: https://s35.gb.ucc.cit.tum.de
          ignoreCertErrors: false
    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-preview
      configuration:
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        backend:
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
          version: 1.108.33

Here's my package.json:

{
    "name": "atpreportvariant",
    "version": "0.1.0",
    "private": true,
    "description": "ATP Report",
    "keywords": [
        "ui5",
        "sapui5",
        "adaptation-project"
    ],
    "devDependencies": {
        "@sap/ux-ui5-tooling": "1",
        "@ui5/cli": "^3.9.2",
        "@ui5/task-adaptation": "^1.3.0",
        "ui5-tooling-modules": "^3.18.7"
    },
    "scripts": {
        "build": "ui5 build --exclude-task generateFlexChangesBundle generateComponentPreload minify --clean-dest",
        "start": "fiori run --open /test/flp.html#app-preview",
        "start-editor": "fiori run --open /test/adaptation-editor.html"
    },
    "dependencies": {
        "exceljs": "^4.4.0",
        "jspdf": "^2.5.2"
    }
}

Desktop (please complete the following information):

  • OS: Windows 11
  • Node.js: Been switching between v22, v20 and v18

P/S: I'm happy to share my entire source code for your further inspection.

@petermuessig
Copy link
Member

Hi @mmotkim,

as you suggest, maybe you could provide me your source code (if you are SAP internal, just write to me internally to share the source code). This would make the analysis easier. I'm wondering a bit why you exclude jsPDF from transformation. The debug flag should be debug: true - no string. Do you somewhere have a resourceroots or sap.ui.loader.config configuration which maps jsPDF to another place?

THX and BR,
Peter

@mmotkim
Copy link
Author

mmotkim commented Dec 3, 2024

Hi @petermuessig, thanks for the reply!

I'm happy you could help, I've just added you to the repo.
For your questions:

  • jspdf had 3 kinds of files, I was trying to skip the first 2 files ( jspdf.es..js & jspdf.node..js ) from transformation as a guess that it would use the third one (Described in jspdf's documentation: jspdf.umd.*.js: UMD module format. For AMD or script-tag loading.)
  • And I didn't touch sap.ui.loader.config.

The issue is still present and I've been making some changes to the app since the day I posted the issue:

  • Switched to pdf-lib instead but the error is still the same
  • Clean up the ui5.yaml:
# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json

specVersion: "3.0"
metadata:
  name: atpreportvariant
type: application
resources:
  configuration:
    propertiesFileSourceEncoding: UTF-8
builder:
  customTasks:
    - name: ui5-tooling-modules-task
      afterTask: replaceVersion
      configuration:
        addToNamespace: true
customConfiguration:
  adp:
    support:
      id: "@sap/generator-adaptation-project"
      version: 1.1.63
      toolsId: 09edfc9e-5876-4488-a154-8d943eb1994e
server:
  customMiddleware:
    - name: ui5-tooling-modules-middleware
      afterMiddleware: compression
    - name: fiori-tools-appreload
      afterMiddleware: ui5-tooling-modules-middleware
      configuration:
        port: 35729
        path: webapp
        delay: 300
    - name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        adp:
          target:
            client: "302"
            url: https://s35.gb.ucc.cit.tum.de
          ignoreCertErrors: false
    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-preview
      configuration:
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        backend:
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
          version: 1.108.33

Edit: Interestingly, the adaptation editor didn't produce any errors and it could run just fine, it's just the Application Preview function in VSCode that didn't work

@petermuessig
Copy link
Member

@mmotkim : AFAICS, it is an application variant project - so changes will be applied to the original application and the modules will be loaded relative to the application. I didn't think about this scenario so far.

If you open the following URL: http://localhost:8080/resources/pdf-lib.js - does it show up and has a sap.ui.define preamble?

@mmotkim
Copy link
Author

mmotkim commented Dec 3, 2024

@petermuessig Yes it does, http://localhost:8080/resources/pdf-lib.js returns the code starting with

sap.ui.define(['exports', 'customer/atpreportvariant/resources/_commonjsHelpers'], (function (exports, _commonjsHelpers) { 'use strict';

    var tslib = {exports: {}};

    (function (module) {
      var __extends;

@petermuessig
Copy link
Member

Ok, then the problem is related to running the ExportToExcel.js in context of the original application:

Image

URL: /customer/atprepreportvariant/resources/pdf-lib.js isn't handled by the ui5-tooling-modules-middleware.

You could maybe add for testing the following in the beginning of the ExportToExcel.js:

sap.ui.loader.config({
  paths: {
    "pdf-lib": "/resources/pdf-lib" 
  }
});

sap.ui.define(...

This ensures to re-route the pdf-lib request to the server root. This is only a workaround to see whether it works or not. I want to redirect the request to /resources/pdf-lib.js.

@mmotkim
Copy link
Author

mmotkim commented Dec 3, 2024

I added your sap.ui.loader.config and it still produced the same error, even when I tried to add the jspdf dependency reroute like this:

sap.ui.loader.config({
  paths: {
    "pdf-lib": "/resources/pdf-lib",
    "_commonjsHelpers.js": "/resources/_commonjsHelpers.js",
  },
});

Image

@petermuessig
Copy link
Member

For the _commonjsHelper you need to avoid the file extension .js - but it underlines my assumption that it is related to the application variant running the code in context of the application and thus tries to load the app/resources/* relative to the application path. Maybe the proxy can be configured in a way that it re-routes to the server roots /resource*`?

@mmotkim
Copy link
Author

mmotkim commented Dec 3, 2024

But when I used ExcelJS for the application variant at first it worked flawlessly, Only when adding pdf-js/removing ExcelJS and adding pdf-js that it cried about not being able to load the .js
The problem maybe from pdf-js and jsPDF both depending on _commonjsHelpers.js while ExcelJS doesn't?
For your references I've tried PDFKit), pdfmake and IronPDF all to no avail, throwing similar error messages (If I remember correctly)

@petermuessig
Copy link
Member

What you can do is the following - add a backend mapping for the /custom/atpreportvariant/resources to the fiori-tools-proxy configuration and map it to http://localhost:8080:

    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-appreload
      configuration:
        debug: true
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        backend:
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap
          - path: /customer/atpreportvariant/resources
            pathReplace: /resources
            url: http://localhost:8080
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
          version: 1.108.33

@mmotkim
Copy link
Author

mmotkim commented Dec 3, 2024

Thanks for the resolution, I added the mapping along with the sap.ui.loader.config above but it still produced the same error when previewing:
Image

@petermuessig
Copy link
Member

The sap.ui.loader.config isn't needed with the proxy configuration in place. I think the path is just wrong for you - can you share your network trace for the failing requests and their URL? At least for one of the requests which fails. I think we need to adopt the path in the proxy to make it finally working.

@mmotkim
Copy link
Author

mmotkim commented Dec 4, 2024

Alright, I removed sap.ui.loader.config then ran the Preview, retrying with keeping your proxy config and not keeping.
There were 2 failed GET reqs with the same URL and headers in both tries:
http://localhost:8080/sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources/_commonjsHelpers.js

Headers

GET /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources/_commonjsHelpers.js HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9,vi;q=0.8
Connection: keep-alive
Cookie: sap-usercontext=sap-language=EN&sap-client=302; SAP_SESSIONID_S35_302=aNKFm2sFP6UW1JUxJqk4bHKynoWyDxHvmE9ldA41RTs%3d
Host: localhost:8080
Referer: http://localhost:8080/test/flp.html
Sec-Fetch-Dest: script
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
sec-ch-ua: "Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"

@petermuessig
Copy link
Member

petermuessig commented Dec 4, 2024

@mmotkim

Please try the following configuration in the proxy:

          - path: /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources
            pathReplace: /resources
            url: http://localhost:8080

What I don't like is the static definition of the cachebuster token in the URL - but it should be at least for the whole application - so it may work then for all the requests.

@tobiasqueck @Klaus-Keller - is it possible to use a regex in the Fiori tools proxy? I tried it but I run into an endless loop. Maybe this would be an interesting feature to proxy such kind of requests and to be able to ignore the cachebuster token segment. THX

@mmotkim
Copy link
Author

mmotkim commented Dec 4, 2024

There were still 2 of those same failed requests URLs.

I add the config to fiori-tools-proxy like this:

customMiddleware:
    - name: ui5-tooling-modules-middleware
      afterMiddleware: compression
    - name: fiori-tools-appreload
      afterMiddleware: ui5-tooling-modules-middleware
      configuration:
        port: 35729
        path: webapp
        delay: 300
    - name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        adp:
          target:
            client: "302"
            url: https://s35.gb.ucc.cit.tum.de
          ignoreCertErrors: false
    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-preview
      configuration:
        ignoreCertError: false
        backend:
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap
          # - path: /customer/atpreportvariant/resources
          #   pathReplace: /resources
          #   url: http://localhost:8080
          - path: /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources
            pathReplace: /resources
            url: http://localhost:8080
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
          version: 1.108.33

I used Text compare to make sure the static definitions in the urls were identical, is there something preventing proxy configuration from catching the path?

Edit:
I just noticed the log saying the middlewares did catch those paths but used the client=032 config instead, I moved your configuration to the topmost and managed to get it to work

    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-preview
      configuration:
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        backend:
          - path: /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources
            pathReplace: /resources
            url: http://localhost:8080
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap

Thanks a lot! Would there be any problems when I deploy?

@tobiasqueck
Copy link

@petermuessig @mmotkim I don't think your setup is a good idea. I am also not sure how this is supposed to work after deployment.
Let me explain what I understood and what concerns me:

  • you have an on-prem system (or at least not an S/4HANA Cloud Public Edition) - that's important because it means your adaptation will be deployed to LREP and not as a BSP like an app
  • in your local setup you use a middleware to pretend that jspdf will be part of the deployed bundle
    • Does this actually work when being deployed to LREP? It might be but I have never seen it, so I would test this first before further looking into a local setup
  • for a reason that I could not understand, your app "thinks" that it can find the jspdf module at /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5/resources
    • My guess is that you already deployed the jspdf module as a reuse library in your ABAP backend
    • Since your ADP knows about, I assume it is already declared in the manifest.json of the original app - or you added a change to your ADP that adds the reuse lib
    • Is my understanding correct or did I misunderstand something?

If my assumptions are correct then removing the ui5-tooling-modules-middleware as well as the additional configuration you added to the fiori-tools-proxy and the sap.ui.loader.config should solve the problem because the fiori-tools-preview would resolve the url of your reuse lib during startup.

@mmotkim
Copy link
Author

mmotkim commented Dec 4, 2024

Let me further elaborate on the reproduction steps:

  1. Connecting an on-premise system, I used @sap/generator-fiori on VSCode using the analytical list page template. It was then deployed as an BSP only using nwabap-ui5uploader
  2. I then used @sap/generator-adaptation-project to create an adaptation application from that BSP on the system. The generator already set up the proxy for me according to the system info provided.
  3. In order to use ui5-tooling-modules after adding name: ui5-tooling-modules-middleware I had to line up fiori-tools-proxy to run after ui5-tooling-modules-middleware. It was this afterMiddleware property that I had to change so that the preview doesn't show up as blank.
    - name: fiori-tools-appreload
      afterMiddleware: ui5-tooling-modules-middleware

The middleware should run in order of ui5-tooling-modules-middleware -> fiori-tools-appreload -> fiori-tools-preview -> fiori-tools-proxy If I understand correctly
4. I used npm i ExcelJS and got it to work just fine, but npm i jspdf caused this whole issue. I didn't deploy any reuse libraries to the backend.

Hope it can help, @tobiasqueck

@mmotkim mmotkim changed the title failed to load JavaScript resource for jspdf [ui5-tooling-modules] failed to load JavaScript resource for jspdf Dec 4, 2024
@tobiasqueck
Copy link

@mmotkim a few more question to ensure I got the full picture:

  • Is/sap/bc/ui5_ui5/sap/zatpr the path of your ALP i.e. the original app?
  • You intend to deploy jspdf as part of your ADP?
  • Your original ALP doesn't refer to jspdf at all?

I used npm i ExcelJS and got it to work just fine, but npm i jspdf caused this whole issue.

That one confuses me. The only reason that I could guess would be that your original app already knows one of the two. Is that the case?

@petermuessig
Copy link
Member

@tobiasqueck - the application variant comes with a custom code ExportToExcel.js which includes thirdparty. Therefore @mmotkim uses the ui5-tooling-modules to access it. As the UI5 resources are loaded relative to the application variant in the ABAP system, we need to redirect it for the local development to the localhost UI5 dev server so that the ui5-tooling-modules middleware can process it.

Now, for the deployment, there should be no issue anymore - as the build is prefixing the imports of the thirdparty with the namespace of the application variant - see here the build output of the ExportToExcel.js:

Image

With that the thirdparty is addressed relative to the application variant and I don't see a problem here.

The main issue was about pointing the thirdparty requests during development to the ui5-tooling-modules middleware since the proxy catched the requests and proxied them to the ABAP server instead.

@tobiasqueck
Copy link

The main issue was about pointing the thirdparty requests during development to the ui5-tooling-modules middleware since the proxy catched the requests and proxied them to the ABAP server instead.

That is what confuses me because the preview middleware generates an html (you can check the source in the browser when testing) that tells UI5 to find all the original app files and the adaptation files at /. You should not need an additional redirect in your ui5.yaml. That's why I still believe the deployed ADP won't work because something is missing that I haven't understood yet.

@petermuessig
Copy link
Member

The main issue was about pointing the thirdparty requests during development to the ui5-tooling-modules middleware since the proxy catched the requests and proxied them to the ABAP server instead.

That is what confuses me because the preview middleware generates an html (you can check the source in the browser when testing) that tells UI5 to find all the original app files and the adaptation files at /. You should not need an additional redirect in your ui5.yaml. That's why I still believe the deployed ADP won't work because something is missing that I haven't understood yet.

But the thirdparty is not rewritten so far during local development. The rewrite (prefix with the application namespace) only takes place during the build. I already thought about this feature but it would again require a bigger rework. Maybe there's some time during the next x-mas vacation for that... ;-)

@tobiasqueck
Copy link

@petermuessig would addToNamespace: true in the ui5-tooling-modules-middleware config maybe solve the problem?

@petermuessig
Copy link
Member

This is exactly the missing feature which would solve it in general. Right now, all thirdparty requests will go through /resources/* and not through the application namespace...

@tobiasqueck
Copy link

This is exactly the missing feature which would solve it in general. Right now, all thirdparty requests will go through /resources/* and not through the application namespace...

Sorry, I wrote my response before I read your last message. Now I am getting the problem!

@petermuessig
Copy link
Member

Related issue: #1049

@tobiasqueck
Copy link

tobiasqueck commented Dec 4, 2024

It's a misuse of a feature but could you try the following in your preview-middleware config:

- name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        flp:
          apps:
          - target: /resources
            componentId: customer.atpreportvariant.resources
        adp:
          target:
            client: "302"
            url: https://s35.gb.ucc.cit.tum.de
          ignoreCertErrors: false

That's a wild guess that may work ...

@mmotkim
Copy link
Author

mmotkim commented Dec 4, 2024

I just tried, it worked as well!

Also to answer your questions:

  • Is/sap/bc/ui5_ui5/sap/zatpr the path of your ALP i.e. the original app? Yes
  • You intend to deploy jspdf as part of your ADP? However so that it will work after deployment
  • Your original ALP doesn't refer to jspdf at all? No it doesn't. I needed to add custom exporting features to the original app and ALP doesn't support controller code nor 3rd party libraries and the only solution was to use ADP.
    I decided on exceljs and jspdf/js-pdf after implementing ui5-tooling-modules because this tooling extension is theonly method for 3rd party libs that I found to be working for ADP.

@tobiasqueck
Copy link

I just tried, it worked as well!

I am happy to hear that. I'd suggest to use it as a workaround until #1049 is available. Afterwards, you shouldn't need it anymore.

@mmotkim
Copy link
Author

mmotkim commented Dec 4, 2024

@tobiasqueck @petermuessig
I just noticed today, both of your methods made the Preview Application work but used the entire codebase from a previous app version deployed to the backend.. haha

I was changing some code but didn't see anything different when reloading, even with new console.log.
A few days ago (After posting this issue) I did deploy for the first time to the server for testing, I had the dist folder saved and compared its ExportToExcel.js with the output when running the app to make sure.

I just redeployed once more and ran the Preview Application when the change finally displayed, which means I have to literally redeploy each time I want to see my changes :) Fortunately the Adaptation Editor still works live

@petermuessig
Copy link
Member

But how could that be? In my suggested approach, the mapping is only redirecting the application variant local resources path. The application variant must still be loaded locally - or - hmm, no - the path the application variant is loaded is from /sap/bc/ui5_ui5/sap/zatpr/~3652DD8F6F55485147ACA7924D0C9999~5 which is a backend URL and proxied to the ABAP system. Maybe this is the overall issue - why isn't this pointing to the local server? Or is there something missing? @tobiasqueck how is this supposed to work with the application variants? Should the URL point to the server root of localhost or to the proxied URL and the proxy redirects to the local application version?

Maybe a solution is to redirect the full application? With Tobias suggestion slightly changed:

- name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        flp:
          apps:
          - target: /
            componentId: customer.atpreportvariant

=> Redirecting the variant to the server root

@tobiasqueck
Copy link

The preview middleware merges the original manifest with the appdescr changes and then starts the app. When a file is locally available it will use it, otherwise, it will proxy the request to the original app. I doubt that my proposal above caused the loading of the files from the backend instead of locally.

@mmotkim
Copy link
Author

mmotkim commented Dec 9, 2024

@tobiasqueck The preview seems to still be using the changes present on the server, maybe the problem lies in Preview Application's command fiori run --open /test/flp.html#app-preview ?
EDIT: I just tried previewing without your configuration, of course it throws the 'failed to load resource' again, but It still seems to be load the ExportToExcel.js from the backend as well.
Here's the Request URL for that that file, it's the same URL for both cases (using and not using your config):
http://localhost:8080/sap/bc/lrep/flex/modules/customer.atpreportvariant?sap-language=EN
I will try to look deeper into this.

But there's another problem today, I just configured the fiori launchpad and started the ADP when it threw the same error for my first working library ExcelJS:

Image

The URL were: /sap/bc/ui5_ui5/ui2/ushell/resources/~20240619115500~/exceljs.js
I had my yaml configuration like this for the lastest deployment:

# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json

specVersion: "3.0"
metadata:
  name: atpreportvariant
type: application
resources:
  configuration:
    propertiesFileSourceEncoding: UTF-8
builder:
  customTasks:
    - name: ui5-tooling-modules-task
      afterTask: replaceVersion
      configuration:
        addToNamespace: true
customConfiguration:
  adp:
    support:
      id: "@sap/generator-adaptation-project"
      version: 1.1.63
      toolsId: 09edfc9e-5876-4488-a154-8d943eb1994e
server:
  customMiddleware:
    - name: ui5-tooling-modules-middleware
      afterMiddleware: compression
    - name: fiori-tools-appreload
      afterMiddleware: ui5-tooling-modules-middleware
      configuration:
        port: 35729
        path: webapp
        delay: 300
    - name: fiori-tools-preview
      afterMiddleware: fiori-tools-appreload
      configuration:
        flp:
          apps:
            - target: /resources
              componentId: customer.atpreportvariant.resources
        adp:
          target:
            client: "302"
            url: https://s35.gb.ucc.cit.tum.de
          ignoreCertErrors: false
    - name: fiori-tools-proxy
      afterMiddleware: fiori-tools-preview
      configuration:
        ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
        backend:
          # - path: /sap/bc/ui5_ui5/sap/zatpr/~6B559E7121C9D296876EAB4772A343FD~5/resources
          #   pathReplace: /resources
          #   url: http://localhost:8080
          - client: "302"
            url: https://s35.gb.ucc.cit.tum.de
            path: /sap
            # - path: /customer/atpreportvariant/resources
            #   pathReplace: /resources
            #   url: http://localhost:8080
        ui5:
          path:
            - /resources
            - /test-resources
          url: https://ui5.sap.com
          version: 1.108.33

Really appreciate if you could help!!

@mmotkim
Copy link
Author

mmotkim commented Dec 9, 2024

Additional Info: I just undeployed and redeployed then checked the deployment log and didn't see any resource files being pushed.
I was using the Deployment Wizard tool ( @sap/adp-cli ) in VSCode as that's the only option when no ui5-deploy.yaml file were there when I generated this project.

Here's the log:

No change to package.json was detected. No package manager install will be executed.
          ↪ 
System response result:
          ↪ [{"severity":"Info"
          ↪ "id":"/UI5/DTA:038"
          ↪ "text":"Information : File 'manifest' written into layer 'CUSTOMER_BASE' of the layered repository (/UI5/DTA 038)"
          ↪ "variables":["manifest"
          ↪ "CUSTOMER_BASE"]}
          ↪ {"severity":"Info"
          ↪ "id":"/UI5/DTA:038"
          ↪ "text":"Information : File 'id_1732779784744_164_addXML' written into layer 'CUSTOMER_BASE' of the layered repository (/UI5/DTA 038)"
          ↪ "variables":["id_1732779784744_164_addXML"
          ↪ "CUSTOMER_BASE"]}
          [bunch of .change files] ...
          ↪ {"severity":"Info"
          ↪ "id":"/UI5/DTA:038"
          ↪ "text":"Information : File 'ExportToExcel' written into layer 'CUSTOMER_BASE' of the layered repository (/UI5/DTA 038)"
          ↪ "variables":["ExportToExcel"
          ↪ "CUSTOMER_BASE"]}
          ↪ {"severity":"Info"
          ↪ "id":"/UI5/DTA:038"
          ↪ "text":"Information : File 'ExportToPdf.fragment' written into layer 'CUSTOMER_BASE' of the layered repository (/UI5/DTA 038)"
          ↪ "variables":["ExportToPdf.fragment"
          ↪ "CUSTOMER_BASE"]}
          ↪ {"severity":"Info"
          ↪ "id":"/UI5/DTA:038"
          ↪ "text":"Information : File 'export.fragment' written into layer 'CUSTOMER_BASE' of the layered repository (/UI5/DTA 038)"
          ↪ "variables":["export.fragment"
          ↪ "CUSTOMER_BASE"]}
          ↪ END - system response result.

Project deployed successfully!

The thirdparty library folder seems to be ignored during adaptation deployment, where should i go about from this? I'm thinking of adding the libraries in the base application then deploy them or adding a custom deployment config that bring the 'thirdparty' with itself in the ADP

@tobiasqueck
Copy link

This is more a general ADP with custom modules issue then a tools issue, I think. It might make more sense for you to open an incident that support can have a closer look at you projects and backend.
Otherwise, @testojs do you have any idea here?

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

No branches or pull requests

3 participants