teambit / bit

A build system for development of composable software.
https://bit.dev
Other
17.87k stars 927 forks source link

The CJS build of Vite's Node API is deprecated for new workspace with custom react environment #9074

Closed sbland closed 2 months ago

sbland commented 3 months ago

Describe the bug

I get the following warning for a new workspace with custom react env The CJS build of Vite's Node API is deprecated

Steps to Reproduce

  1. bit init
  2. bit create react-env envs/my-react-env --aspect bitdev.react/react-env
  3. bit create react demo-component --env envs/my-react-env
  4. bit test

Specifications

for harmony workspace

Jinjiang commented 3 months ago

@sbland No worries. It's totally fine to proceed. The removal of Vite CJS build won't happen in a short moment.

And BTW, the warning message was actually caught by some core Vite plugins in Vite community. So it definitely works except Vite want to break their own world. 😉

Anyway, we are keeping an eye on that and will update accordingly once the relevant core plugins are updated.

itaymendel commented 2 months ago

fix shipped for this. there was an issue with the component that loads ESM modules to CJS (https://bit.cloud/bitdev/node/modules/load-esm-module/~api-reference). to update run bit env update && bit update "@teambit/**,@bitdev/** to update all deps and rerun the test/build commands.