Skip to content

[Regression] InlineAutocomplete uses ESM only module textarea-caret breaking Next.js #2238

Description

@Swiftwork

Describe the bug
The changes introducing InlineAutocomplete break previously working builds using Next.js due to the fact that it uses the ESM only module @koddsson/textarea-caret.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a new next.js app
  2. Add @primer/react
  3. Use primer components
  4. See error

Expected behavior
Continued support for Next.js with no build errors. Possibly by inlining work provided by @koddsson/textarea-caret @primer/react.

Screenshots

Error: require()ofESModule C:\Projects\Git\@org\project\.yarn\cache\@koddsson-textarea-caret-npm-4.0.1-58e5d1bae2-7a44f96cdf.zip\node_modules\@koddsson\textarea-caret\index.jsfromC:\Projects\Git\@org\project\.yarn\__virtual__\@primer-react-virtual-c9b4fb8b62\0\cache\@primer-react-npm-35.6.0-0eb6ab2331-c71e61be84.zip\node_modules\@primer\react\lib\drafts\utils\character-coordinates.jsnotsupported.Insteadchangetherequireofindex.jsinC:\Projects\Git\@org\project\.yarn\__virtual__\@primer-react-virtual-c9b4fb8b62\0\cache\@primer-react-npm-35.6.0-0eb6ab2331-c71e61be84.zip\node_modules\@primer\react\lib\drafts\utils\character-coordinates.jstoadynamicimport()whichisavailableinallCommonJSmodules.atObject.require$$0.Module._extensions..js(C:\Projects\Git\@org\project\.pnp.cjs:19891:15)atModule.load(node:internal/modules/cjs/loader:981:32)atFunction.require$$0.Module._load(C:\Projects\Git\@org\project\.pnp.cjs:19735:14)atModule.require(node:internal/modules/cjs/loader:1005:19)atrequire(node:internal/modules/cjs/helpers:102:18)atObject.<anonymous>(C:\Projects\Git\@org\project\.yarn\__virtual__\@primer-react-virtual-c9b4fb8b62\0\cache\@primer-react-npm-35.6.0-0eb6ab2331-c71e61be84.zip\node_modules\@primer\react\lib\drafts\utils\character-coordinates.js:8:45)atModule._compile(node:internal/modules/cjs/loader:1105:14)atObject.Module._extensions..js(node:internal/modules/cjs/loader:1159:10)atObject.require$$0.Module._extensions..js(C:\Projects\Git\@org\project\.pnp.cjs:19895:33)atModule.load(node:internal/modules/cjs/loader:981:32){code: 'ERR_REQUIRE_ESM'}

Desktop (please complete the following information):

  • OS: All
  • Browser: All
  • Version: 35.6.0

Smartphone (please complete the following information):

  • Device: All
  • OS: All
  • Browser: All
  • Version: 35.6.0

Activity

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

Metadata

Metadata

Assignees

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