geist-org / geist-ui

A design system for building modern websites and applications.
https://geist-ui.dev
MIT License
4.33k stars 334 forks source link

GeistUI with Next 11, Typescript and Yarn 2 with pnp throws a "Module not found" error #561

Closed sannajammeh closed 3 years ago

sannajammeh commented 3 years ago

Bug report šŸž

I am using NextJS@11.0.0 with Typescript and have set up Yarn 2 in my project.
I proceeded to start next with yarn dev and everything compiled successfully. I then ran yarn add @geist-ui/react, stopped the app, modified _app.tsx to look like this:

import type { AppProps } from "next/app";
import { GeistProvider, CssBaseline } from "@geist-ui/react";

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <GeistProvider>
      <CssBaseline />
      <Component {...pageProps} />
    </GeistProvider>
  );
}
export default MyApp;

and ran it again. When navigating to a page I receive a "module not found" error in the console and the browser pointing to the auto-complete.js file in the yarn cache.

Everything works if I remove Geist UI from my app scripts.

I, therefore, inspected the zip files in the following location and found this import

import _extends from "@babel/runtime/helpers/esm/extends";

at line 1 in .yarn\cache\@geist-ui-react-npm-2.1.5-714ca6763e-2ef99fa586.zip\node_modules\@geist-ui\react\esm\auto-complete\auto-complete.js to be the culprit.

Running yarn add @babel/runtime fixes the issue.

Version & Environment

Expected Behaviour

The pages should compile properly without the Module not found error.

Actual results (or Errors)

Using yarn berry and PNP I receive the following shell error when navigating to any page in the browser:

wait  - compiling...
error - .yarn/cache/@geist-ui-react-npm-2.1.5-714ca6763e-2ef99fa586.zip/node_modules/@geist-ui/react/esm/auto-complete/auto-complete.js:1:0
Module not found: Can't resolve '@babel/runtime/helpers/esm/extends'
null

Running yarn add @babel/runtime and restarting next fixes the issue.

unix commented 3 years ago

Thank you for the bug report, the issue has been solved. This fix will not be merged into the master branch due to the large changes made to the module system. This fix is expected to be added to the next canary release in the next few days.

PS: The next canary release will contain breaking updates, and I'll add a detailed document on how to migrate later.

unix commented 3 years ago

version v2.2.0-canary.7 is out. release notes