openfun / jitsi-magnify

An authentication and room management system for Jitsi built with Django/React
MIT License
23 stars 6 forks source link

Production build is broken #157

Closed jbpenrath closed 1 year ago

jbpenrath commented 1 year ago

Bug Report

Problematic behavior The production build is currently broken until we disable rollup treeshaking (#156).

The <ThemeContext.Extend /> module is implied within the error. This module override globally the ThemeContext provided by styled-components so this is a side effects. It seems rollup removes this module from the bundle during tree shaking... Grommet had previously a similar issue with Webpack (https://github.com/grommet/grommet/issues/2669) but seems to fix that by adding a sideEffects attribute within its package.json. Right now, it seems that is this specific attribute that generate bundle error with rollup... (If we remove this attribute, all is working well...).

Expected behavior/code The production build should work with rollup treeshaking enable.

Steps to Reproduce

  1. yarn build
  2. Go to magnify-site package directory
  3. yarn preview
  4. Go to http://localhost:4173
  5. Display a view using the Toggle Component
  6. Then boom... 💥

Environment

Possible Solution

Additional context/Screenshots