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

Resolve esbuild warnings #399

Open
itworksafisher opened this issue Nov 21, 2024 · 2 comments
Open

Resolve esbuild warnings #399

itworksafisher opened this issue Nov 21, 2024 · 2 comments

Comments

@itworksafisher
Copy link

Brief bug description

What went wrong?

After upgrading angular to v18 and using the new build system, which is esbuild instead of webpack, I see the following error.

▲ [WARNING] Calling "urlParse" will crash at run-time because it's an import namespace object, not a function [call-import-namespace]

    node_modules/@kontent-ai/delivery-sdk/dist/es6/utilities/delivery-url.helper.js:8:22:
      8 │     const parsedUrl = urlParse(url);
        ╵                       ~~~~~~~~

  Consider changing "urlParse" to a default import instead:

    node_modules/@kontent-ai/delivery-sdk/dist/es6/utilities/delivery-url.helper.js:1:7:
      1 │ import * as urlParse from 'url-parse';
        │        ~~~~~~~~~~~~~
        ╵        urlParse

Repro steps

Build an angular project which uses the delivery SDK and is using the newer esbuild.

Expected behavior

No warnings about urlParse.

Test environment

  • Platform/OS: node v22, angular v18

Additional context

Happens with both delivery-sdk v14 and v15.

@itworksafisher
Copy link
Author

itworksafisher commented Nov 21, 2024

warning is considered valid via angular CLI. Any chance of using a default import instead of namespaced?

@itworksafisher
Copy link
Author

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

1 participant