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

fix(dev): Silence ESM-only warning when building for ESM #6822

Closed

Conversation

ngbrown
Copy link
Contributor

@ngbrown ngbrown commented Jul 13, 2023

Closes: #6766

When targeting ESM module format (like the default Express template does) with the configuration of serverModuleFormat: "esm", there is no need to warn about ESM-only dependencies for the node server build.

The current warning looks like this:

[warn] esm-only package: browser-bunyan
┃ browser-bunyan is possibly an ESM-only package.
┃ To bundle it with your server, include it in `serverDependenciesToBundle`
┃ -> https://remix.run/docs/en/main/file-conventions/remix-config#serverdependenciestobundle
┗

Testing Strategy:

I tested this change with ESM-only dependencies (quick-lru and browser-bunyan) on the Remix Express template. There is now no warning output and the ESM-only module still works correctly (when removed from serverDependenciesToBundle).

@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2023

🦋 Changeset detected

Latest commit: fec05f5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch
@remix-run/vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ngbrown ngbrown force-pushed the no-esm-only-warning-on-esm-build branch from 26fdb2a to fec05f5 Compare July 18, 2023 17:39
@pcattori
Copy link
Contributor

Superceded by #6916

@pcattori pcattori closed this Jul 21, 2023
@ngbrown ngbrown deleted the no-esm-only-warning-on-esm-build branch February 19, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants