Open AdrianHouseholder opened 2 months ago
Hi!
Have you tried disabling the plugin for the deployment build (maybe using an env var or something)?
The problem that this plugin solves is specific to Node, it doesn't apply to Cloudflare's workerd
runtime. As far as I know, Cloudflare uses ESBuild to bundle the worker and ESBuild can fix CJS interop issues better than this plugin.
Closing due to inactivity.
I am using Cloudflare to host my Remix.js app, and even though the project works perfectly locally, and before adding Apollo, when I try to deploy it to Cloudflare, I get the following errors:
I understand that the cjsInterop1 import naming convention is basically what the plugin does underneath, but it looks like Wrangler doesn't like it.
The reason why I needed this plugin was because I am using Apollo to consume my Graphql API, and it considers the library to be CommonJS. The plugin made the project work flawlessly locally, but unfortunately, I've run into this error once I try to deploy it.
I ran into this issue here, but does not work in my case: https://community.cloudflare.com/t/wrangler-throws-error-with-package-type-module-and-webpack-config-js/339507
Any ideas? Thank you in advanced!