-
Notifications
You must be signed in to change notification settings - Fork 74
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Preview server error since 0.7.2 in yarn workspace #163
Comments
Thanks for filing an issue @willviles and apologies for the breaking change on a patch release.
A small repo that reproduces the issue would be incredible, but I know that's a pain to put together so maybe I could try to cobble one together with the above info. |
Also, you might try upgrading to latest (0.7.4). There was a small problem in the 0.7.2 release (though I don't think it would be related). |
Hi @psugihara, firstly thanks for such an awesome mail library 👍 I've created a minimal repo here for my use case. I'm using Mailing inside an The issue arises when I export a helper class for my Sendgrid logic (importing All of my email logic doesn't necessarily need to be exported from the root module, but I'd ideally like it so that the import { sendMail, Sendgrid, FooEmail, BarEmail } from 'email' Understand this may be an annoyingly atypical use case of the library, but this does work if mailing is downgraded to |
Got it, thanks so much for the clean repro repo! I'm away from my dev machine today but will try it this week.
|
Thanks for the repro repo :) I just had a moment to boot it and inspect the emitted moduleManifest.ts. the first thing I notice is that it is bigger than it should be (~100KB vs. ~10KB) and the http part it looks like is being bundled although it should be considered an external dependency and not bundled. i.e. it looks like it is bundling all external dependencies. The line that indicates this to esbuild is the
esbuild docs: https://esbuild.github.io/api/#external and looking at that, I can see why - because it is looking at the wrong package.json to discover dependencies to exclude. i.e. this is a side effect of the folder structure here -- is this a common setup for turbo/monorepos? I'm pretty sure that is the cause. i think we might want to read the package.json that's in .mailing like we do here instead of with in import statement. let me see if that would work, or let me know if you have another idea |
We're also not excluding devDependencies |
mm, I think it is actually to do with the fact that @sendgrid/client includes axios, but axios is not declared as a dependency. instead of looking at package.json for what packages are available in the environment, we may have to ask yarn or npm for a list? |
seems related: evanw/esbuild#619 |
@willviles @psugihara think I have a solution here, will post a beta to test here soon |
Hi @willviles this is fixed in 0.7.5-next.0 |
…rror fix #163 - esbuild node_modules excludes
Wow, you guys are fast! Can confirm that Thank you @alexfarrill @psugihara for such a speedy fix 👍 |
Thanks for the props Will! 0.7.6 is released and has that fix too. Happy mailing
Alex
…On Fri, Sep 9 2022 at 1:05 AM, Will Viles < ***@***.*** > wrote:
Wow, you guys are fast!
Can confirm that 0.7.5-next.0 is working perfectly in my real world
monorepo.
Thank you @alexfarrill ( https://github.com/alexfarrill ) @psugihara (
https://github.com/psugihara ) for such a speedy fix 👍
—
Reply to this email directly, view it on GitHub (
#163 (comment) ) ,
or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAAGCIWQ42Y2JUKHSJI3LYLV5LVU7ANCNFSM6AAAAAAQDEWWMA
).
You are receiving this because you were mentioned. Message ID: <sofn-xyz/mailing/issues/163/1241643724
@ github. com>
|
Have tried to update to
mailing@^0.7.2
and unfortunately I'm getting this error when attempting to runmailing preview
.There are no errors in a vanilla project, however I'm using Mailing within a yarn workspace, which already contains a next.js app.
Pinning to
mailing@0.7.1
and adding a the following nohoist rules to my rootpackage.json
ensures the error disappears:The text was updated successfully, but these errors were encountered: