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

@transloadit/enrich-tweet: use dynamic import to fix build #56

Merged
merged 3 commits into from
May 7, 2024

Conversation

Murderlon
Copy link
Member

Without this change, running yarn build on latest main:

   ✖  @transloadit/enrich-tweet:tsc
      src/enrichTweet.ts(4,26): error TS1471: Module 'get-urls' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.
      src/enrichTweet.ts(67,16): error TS2349: This expression is not callable.
        Type 'typeof import("/Users/merlijnvos/code/monolib/node_modules/get-urls/index", { with: { "resolution-mode": "import" } })' has no call signatures.

@Murderlon Murderlon requested a review from kvz May 7, 2024 09:26
@Murderlon Murderlon self-assigned this May 7, 2024
@Murderlon
Copy link
Member Author

ugh seems like sucrase now can't handle the dynamic import 🙈

@aduh95
Copy link
Contributor

aduh95 commented May 7, 2024

ugh seems like sucrase now can't handle the dynamic import 🙈

By default sucrase will replace all dynamic import(…)s with Promise.resolve(require(…)), see https://arc.net/l/quote/dnflojch

@aduh95 aduh95 merged commit 4b10adc into main May 7, 2024
1 check passed
@aduh95 aduh95 deleted the enrich-tweet-esm branch May 7, 2024 10:57
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 this pull request may close these issues.

2 participants