Skip to content
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

Embroider + FastBoot file override compatibility issue #2230

Open
Windvis opened this issue Jan 16, 2025 · 0 comments
Open

Embroider + FastBoot file override compatibility issue #2230

Windvis opened this issue Jan 16, 2025 · 0 comments

Comments

@Windvis
Copy link
Collaborator

Windvis commented Jan 16, 2025

I while ago I ran into an issue when enabling Embroider in a FastBooted app because some dependencies weren't node compatible. It was then suggested to use FastBoot's file overwrite feature to create a noop modifier to bypass the problem. This seemed to work at first, but we ran into issues when deploying this to production and reverted back to the classic build system.

I just revisited the issue again and found the conditions that are needed to reproduce it:

  • The app must be using Embroider
  • The app must be built for production
  • You must be overwriting a file with a fastboot specific version
  • The file that you are overwriting must be importing .css
  • No other files must be importing css (including dependencies)

Once all conditions are met, FastBoot will throw the following error when accessing the app:

Error: Could not find module `fastboot-embroider-repro/app` imported from `~fastboot/app-factory`

The problem is resolved by also importing the css in the overwritten file.

So it seems something goes wrong when bundling the imported css for production if the import happens in a file that is overwritten for FastBoot.

Reproduction: https://github.com/Windvis/fastboot-file-override-embroider-reproduction

Windvis added a commit to lblod/frontend-centrale-vindplaats that referenced this issue Jan 16, 2025
Last time we activated Embroider we ran into an issue when running the production build. This works around that problem so we can enable Embroider again.

More information: embroider-build/embroider#2230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant