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

cant bundle @googlemaps/url-signature #6126

Closed
eladcon opened this issue Apr 3, 2024 · 1 comment
Closed

cant bundle @googlemaps/url-signature #6126

eladcon opened this issue Apr 3, 2024 · 1 comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@eladcon
Copy link
Collaborator

eladcon commented Apr 3, 2024

I tried this:

run:

// main.w
bring cloud;

class X {
  extern "./index.ts" pub static inflight handler(): void;
}

new cloud.Function(inflight () => {
  X.handler();
});
// index.ts
import * as g from "@googlemaps/url-signature";

export const handler = async (event: any) => {
  g.signUrl("https://www.google.com", "key");
};

This happened:

Could not resolve "core-js/modules/es.string.replace.js"

    node_modules/@googlemaps/url-signature/dist/index.umd.js:1:86:
      1 │ ...=typeof exports&&"undefined"!=typeof module?r(exports,require("core-js/modules/es.string.replace.js"),require("core-js/modules/web.dom-collections.iterator.js"),r...
        ╵                                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "core-js/modules/es.string.replace.js" as external to exclude it from the
  bundle, which will remove this error and leave the unresolved path in the bundle. You can also
  surround this "require" call with a try/catch block to handle this failure at run-time instead of
  bundle-time.

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@eladcon eladcon added the 🐛 bug Something isn't working label Apr 3, 2024
@monadabot monadabot added this to Wing Apr 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Apr 3, 2024
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Apr 3, 2024
@MarkMcCulloh
Copy link
Contributor

This is an upstream bug with @googlemaps/url-signature not declaring its dependency googlemaps/js-url-signature#528

The workaround is to explicitly npm i core-js

@github-project-automation github-project-automation bot moved this from 🤝 Backlog - handoff to owners to ✅ Done in Wing Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler
Projects
Archived in project
Development

No branches or pull requests

3 participants