You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular-Shepherd 19 CommonJS build fails with TS2309 #2610
Attempting to upgrade to Angular-Shepherd 19 in a project using moduleResolution: node generates the following error:
Error: node_modules/shepherd.js/dist/cjs/shepherd.d.cts:581:1 - error TS2309: An export assignment cannot be used in a module with other exported elements.
581 export = Shepherd;
~~~~~~~~~~~~~~~~~~
@KeithGillette would you be able to update to "moduleResolution": "bundler"? That's how I fixed things. I am unfamiliar with how Angular usually does things, so if node is required for all Angular projects we probably do need a different fix, but I find it strange that a browser framework would be using node.
Hi, @RobbieTheWagner — Since I opened this issue, I was able to update my Angular 19 project to "moduleResolution": "bundler" since a different dependency of our project corrected their package.jsonexports, which was previously preventing the update, so this is no longer actually a problem for me. However, I think there's an error in the CommonJS distributable in the published Angular-Shepherd 19 package, per the output I reported, as "moduleResolution": "node" worked fine with Angular-Shepherd 18. I see a couple of people reacted to my original post, so this may still be problematic for others.
Reacted by Carlos Delgado, Gleb and szlezakbartosz
Fully agree with @KeithGillette - while this setting solves the problem, it's just a workaround, and not a final solution, which should be considered in a future fix.
Angular definitely supports ESM. The problem is that non-Angular legacy dependencies in projects can prevent upgrading to a moduleResolution that will actually use the Angular-Shepherd ESM distributable and instead try to use Angular-Shepherd's CJS modules, which are not correct, generating the error I reported. I was able to replace the other dependency in my project that was preventing switching moduleResolution, and so now am using the correctly formatting ESM Angular-Shepherd modules, but I think the other commenters on this thread have been unable to do so for their projects, leading to the request to correct the CJS distributable.
So we decided to move to vanilla TS instead of svelte, which I think should fix this. I will release a new version of angular-shepherd targeting the latest shepherd soon.
Activity
RobbieTheWagner commentedon Feb 4, 2025
@KeithGillette would you be able to update to
"moduleResolution": "bundler"? That's how I fixed things. I am unfamiliar with how Angular usually does things, so ifnodeis required for all Angular projects we probably do need a different fix, but I find it strange that a browser framework would be usingnode.KeithGillette commentedon Feb 4, 2025
Hi, @RobbieTheWagner — Since I opened this issue, I was able to update my Angular 19 project to
"moduleResolution": "bundler"since a different dependency of our project corrected theirpackage.jsonexports, which was previously preventing the update, so this is no longer actually a problem for me. However, I think there's an error in the CommonJS distributable in the published Angular-Shepherd 19 package, per the output I reported, as"moduleResolution": "node"worked fine with Angular-Shepherd 18. I see a couple of people reacted to my original post, so this may still be problematic for others.itmilos commentedon Feb 4, 2025
I have the same issue...
cdelgadob commentedon Mar 9, 2025
Fully agree with @KeithGillette - while this setting solves the problem, it's just a workaround, and not a final solution, which should be considered in a future fix.
RobbieTheWagner commentedon Mar 12, 2025
We're actually likely to drop CJS entirely soon and highly recommend that folks use
"moduleResolution": "bundler"FloSojer commentedon Apr 4, 2025
Looking forward to the fix - thanks!
Temporarily I could fix it the following way because I'm not able to set
"moduleResolution": "bundler"Modify the file
Run the command
RobbieTheWagner commentedon Apr 4, 2025
Does Angular not support ESM?
KeithGillette commentedon Apr 4, 2025
Angular definitely supports ESM. The problem is that non-Angular legacy dependencies in projects can prevent upgrading to a
moduleResolutionthat will actually use the Angular-Shepherd ESM distributable and instead try to use Angular-Shepherd's CJS modules, which are not correct, generating the error I reported. I was able to replace the other dependency in my project that was preventing switchingmoduleResolution, and so now am using the correctly formatting ESM Angular-Shepherd modules, but I think the other commenters on this thread have been unable to do so for their projects, leading to the request to correct the CJS distributable.RobbieTheWagner commentedon Apr 5, 2025
We are planning to ship ESM only soon, so I just wanted to understand.
kav-viasat commentedon May 12, 2025
any update on this?
RobbieTheWagner commentedon Jun 30, 2025
No. We are stuck trying to update Shepherd to Svelte 5. I highly recommend folks use
"moduleResolution": "bundler"slifty commentedon Jul 23, 2025
Unfortunately we use a lot of dependencies that don't support ESM (this is the problem with ESM isn't it -- it splits the ecosystem!)
Just wanted to offer a voice of "please continue to support common JS" since that would allow us to continue to use your great tool!
RobbieTheWagner commentedon Feb 10, 2026
So we decided to move to vanilla TS instead of svelte, which I think should fix this. I will release a new version of angular-shepherd targeting the latest shepherd soon.
kav-viasat commentedon Feb 11, 2026
excellent could you please make sure Angular upto 21 is supported when you release the new version.
PAX523 commentedon Feb 13, 2026
You changed the license to AGPL with the new release, which makes this dependency unattractive