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

RSC: Silence unsupported-dynamic-import warning #10750

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jun 7, 2024

We were getting a bunch of warnings like these
image

● [DEBUG] This "import" expression will not be bundled because the argument is not a string literal [unsupported-dynamic-import]

    assets/Routes-!~{00n}~.mjs:12137:18:
      12137 │     return (await import(rdServerPath)).default;

Adding /* @vite-ignore */ doesn't help, because this is an esbuild warning.

There are a lot of issues on the esbuild repo about this warning. evanw/esbuild#1155 is one, and it also lists a whole bunch of others.
Here's an open issue about adding support for comments, like the vite one I've already tried with, for esbuild: evanw/esbuild#1240. When/if that issue gets resolved we should move to using that. For now I'm silencing all "unsupported-dynamic-import" warnings, which isn't ideal, but will have to do for now.
Here's a vite issue about silencing an esbuild warning vitejs/vite#14768, and the answer there is to use esbuild.logLevel, which is what I also do in this PR

@Tobbe Tobbe added release:fix This PR is a fix changesets-ok Override the changesets check labels Jun 7, 2024
@Tobbe Tobbe added this to the RSC milestone Jun 7, 2024
@Tobbe Tobbe merged commit 0b5408a into redwoodjs:main Jun 7, 2024
51 of 54 checks passed
@Tobbe Tobbe deleted the tobbe-rsc-esbuild-silence-unsupported-dynamic-import branch June 7, 2024 17:15
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants