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

Bug: failure to build with Webpack due to "Module not found: Error: Default condition should be last one" [regression] #5731

Closed
birtles opened this issue Mar 18, 2024 · 2 comments · Fixed by #5732

Comments

@birtles
Copy link
Contributor

birtles commented Mar 18, 2024

Lexical version: 0.14.0 and 0.14.1

Steps To Reproduce

  1. Attempt to build a project that uses @lexical/react with Webpack

The current behavior

You get a bunch of errors of the form:

Module not found: Error: Default condition should be last one

The expected behavior

It should build without error.

Analysis

This appears to be a regression from #5618 which changed lexical-react/package.json adding a bunch of exports of the form:

  "exports": {
    "./LexicalAutoEmbedPlugin": {
      "import": {
        "default": "./LexicalAutoEmbedPlugin.esm.js",
        "types": "./LexicalAutoEmbedPlugin.d.ts"
      },
      "require": "./LexicalAutoEmbedPlugin.js"
    },

Webpack wants the default there to come last, i.e. after types.

I've confirmed locally that just switching the order of those two lines in each instance allows the build to pass again.

I'll make up a PR for this as soon as I get a spare moment (I'm currently on leave so feel free to steal this from me).

birtles added a commit to birtles/lexical that referenced this issue Mar 18, 2024
@ivailop7
Copy link
Collaborator

Waiting to see if there are other issues with the version before we publish a 0.14.2

@2wheeh
Copy link
Contributor

2wheeh commented Mar 18, 2024

This is breaking nextjs app as well

image

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

Successfully merging a pull request may close this issue.

3 participants