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

@apollo/client always suggested to be added to serverDependenciesToBundle config (even if already added) #5483

Closed
1 task done
armandabric opened this issue Feb 16, 2023 · 8 comments

Comments

@armandabric
Copy link
Contributor

armandabric commented Feb 16, 2023

What version of Remix are you using?

1.13.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Here a reproduction repository:

https://codesandbox.io/p/sandbox/relaxed-sea-qmnf15?selection=%5B%7B%22endColumn%22%3A29%2C%22endLineNumber%22%3A9%2C%22startColumn%22%3A3%2C%22startLineNumber%22%3A9%7D%5D&file=%2Fremix.config.js

Expected Behavior

Do not suggest @apollo/client package as an ESM only package as it seems to export a CommonJS version.

Actual Behavior

With or without @apollo/client in the serverDependenciesToBundle config Remix is printing message in the console that lead to nowhere.

Without @apollo/client in the serverDependenciesToBundle

When you start the dev server (or the make a build):

$ pnpm build

> @my-package@ build /.../my-package
> remix build

Building Remix app in production mode...
@apollo/client is possibly an ESM only package and should be bundled with "serverDependenciesToBundle in remix.config.js.
Built in 598ms

Even if @apollo/client seems to be CJS compatible, Remix propose to add to the serverDependenciesToBundle config.

With @apollo/client in the serverDependenciesToBundle

When you start the dev server (or the make a build):

$ pnpm build

> @my-package@ build /.../my-package
> remix build

Building Remix app in production mode...
@apollo/client is possibly an ESM only package and should be bundled with "serverDependenciesToBundle in remix.config.js.
ts-invariant is possibly an ESM only package and should be bundled with "serverDependenciesToBundle in remix.config.js.
zen-observable-ts is possibly an ESM only package and should be bundled with "serverDependenciesToBundle in remix.config.js.
Built in 677ms

The @apollo/client package is suggested again (but should not).

@marwan38
Copy link

I have the same thing, but, now that I think about it.. it might be the inner packages.. like @apollo/client/ssr

@epitaphmike
Copy link

I had to add all the internal dependencies individually, run build then I was able to run dev. Had this issue with the @wagmi library after the update. I assume these is a way to wildcard the dependencies if you wanted to load everything.

@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the needs-response We need a response from the original author about this issue/PR label Apr 19, 2023
@armandabric
Copy link
Contributor Author

Still a thing

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Apr 20, 2023
@ariofrio
Copy link

ariofrio commented Jun 8, 2023

This seems to be occuring for the ESM package mdast-util-to-markdown, too. In this case, however, the dev server actually fails to run with the same error as if mdast-util-to-markdown hadn't been added to serverDependenciesToBundle in the first place.

@lensbart
Copy link
Contributor

Same problem here.

@lensbart
Copy link
Contributor

lensbart commented Jul 27, 2023

My workaround is to include /@apollo\/client*/ instead of '@apollo/client'. Then I also had to include '@wry/trie', /ts-invariant*/ and 'zen-observable-ts', because these are transitive dependencies of @apollo/client, and using /ts-invariant*/ instead of 'ts-invariant' due to the same problem.

@pcattori
Copy link
Contributor

pcattori commented Aug 8, 2023

#6916 removed false-positive ESM warnings seen here

@pcattori pcattori closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Closed
Development

No branches or pull requests

7 participants