BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.19k stars 757 forks source link

browser-sync tried to access chalk, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound #2021

Closed kristian closed 1 year ago

kristian commented 1 year ago

Issue details

Executing browser-sync with Yarn 2 PnP gives the following error:

browser-sync tried to access chalk, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Steps to reproduce/test case

Use browser-sync with Yarn 2

Checked in package.json file and indeed chalk is only defined as a devDependency however, because it is used in the public API, which is exposed to dependent packages it should be a dependency instead.

shakyShane commented 1 year ago

Can you try browser-sync@2.28.2 🙏🏻

kristian commented 1 year ago

Thanks @shakyShane, that fixes it! 👍 Would you mind also fixing it for your eazy-logger? Same issue there:

https://github.com/shakyShane/eazy-logger/issues/9

Thanks!

kristian commented 1 year ago

Mhm, just noticed, that eazy-logger is defined without a ^ here:

https://github.com/BrowserSync/browser-sync/blob/master/packages/browser-sync/package.json#L48

Meaning it issue still happens in eazy-logger and because it is hard linked to 4.0.0 fixing & bumping eazy-logger won't fix the issue either and another bump of browser-sync will be required. Sorry for that.

shakyShane commented 1 year ago

@kristian try browser-sync@2.28.3

kristian commented 1 year ago

Jep, that fixed it! Thanks @shakyShane 🙏🏻

shakyShane commented 1 year ago

@kristian thanks for bringing it to my attention

kristian commented 1 year ago

Very welcome, have a good one 👍