Skip to content

Embroider v4 compatBuild no longer supports Webpack; vite's buildOnce is a hardcoded parameter #2699

Description

@ChrisN-transnexus

I'm currently upgrading an Ember 5.12 / Embroider 3 / Webpack 5 v2 addon to Ember 6.8. I updated all the dependencies I could, including moving from Embroider 3 to 4. I started getting the error:

Build Error (Builder) buildOnce is not a function

I tracked this down to the parameter signature for compatBuild in packages/compat/src/default-pipeline.ts:

https://github.com/embroider-build/embroider/blob/main/packages/compat/src/default-pipeline.ts#L42

Based on this new parameter signature, which has a hard-coded vite buildOnce function, @embroider/compat's compatBuild() no longer supports Webpack in v4. The previous parameter signature was compatBuild(app, Webpack, options). Now it is compatBuild(emberApp, buildOnce, options).

Am I reading this correctly?

I use Webpack plugins via packagerOptions.webpackConfig in ember-cli-build. I don't believe some of the things I need to do via Webpack are supported in vite. Does that mean this addon will never upgrade beyond Embroider 3? What happens to my v2 addon when Embroider 4 becomes a hard requirement for Ember 7 or 8, etc?

Also, why isn't this breaking change mentioned in the upgrade guides or deprecations docs? Upgrading Embroider 2 to 3 was previously covered, explicitly showing that compatBuild works with Webpack:

https://github.com/embroider-build/embroider/blob/main/docs/upgrade-guides.md

Where is the upgrading from v3 to v4 doc?

Furthermore, why did the Ember team promote Webpack as the future bundler for Ember applications in 2020/2021 if just four or five years later, the Ember team is going to start abandoning that commitment in favor of vite?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions