blitz-js / blitz-js/blitz

next-ui recipe isn't working as it should

Open
#4,219 1 comment 0 reactions 0 assignees View on GitHub
kind/bug status/triage
Dominant language
TypeScript
Stars
14.1k
Forks
803
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

I wanted to use NextUI on my project, found the recipe, installed and got the error, probably, related to SWC compiler of NextJS

### Paste all your error logs here:

```

wait - compiling /_error (client and server)...
error - ./node_modules/@internationalized/date/dist/import.mjs:1:0
Module not found: Can't resolve '@swc/helpers/_/_class_private_field_init'

Import trace for requested module:
./node_modules/@react-aria/i18n/dist/real-module.mjs
./node_modules/@react-aria/i18n/dist/import.mjs
./node_modules/@nextui-org/system/dist/chunk-5DCY5R7Z.mjs
./node_modules/@nextui-org/system/dist/index.mjs
./node_modules/@nextui-org/react/dist/index.mjs
./src/pages/_app.tsx

https://nextjs.org/docs/messages/module-not-found

```

### Paste all relevant code snippets here:

```
function MyApp({ Component, pageProps }: AppProps) {
const getLayout = Component.getLayout || ((page) => page);
const router = useRouter();
return (

(error.name === 'AuthenticationError' ? router.replace('/auth/login') : undefined)}
resetKeys={[router.asPath]}
onReset={useQueryErrorResetBoundary().reset}
>


{getLayout()}





);
}
```
Note: doesn't matter where to place `NextUIProvider` - the problem in its' existence

### What are detailed steps to reproduce this?

1. `blitz install next-ui`
2. Accept changes in `_app.tsx`
2. Accept changes in `LabeledTextField`

### Run `blitz -v` and paste the output here:

```
Blitz version: 2.0.0-beta.22 (global)
Blitz version: 2.0.0-beta.19 (local)
macOS Monterey | darwin-x64 | Node: v16.19.0

Package manager: npm

System:
OS: macOS 12.6.2
CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
Memory: 152.68 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
Yarn: Not Found
npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
npmPackages:
@blitzjs/auth: 2.0.0-beta.19 => 2.0.0-beta.19
@blitzjs/next: 2.0.0-beta.19 => 2.0.0-beta.19
@blitzjs/rpc: 2.0.0-beta.19 => 2.0.0-beta.19
@prisma/client: 4.7.1 => 4.7.1
blitz: 2.0.0-beta.19 => 2.0.0-beta.19
next: 12.2.5 => 12.2.5
prisma: 4.7.1 => 4.7.1
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: ^4.8.4 => 4.9.3

```

### Please include below any other applicable logs and screenshots that show your problem:

I firstly tried adding NextUI manually, because I forgot about recipies in blitz, but the error was the same. Then I found recipe, installed, but the error was the same. I re-checked, if there are any leftovers after manual installation, but there is no possible way, because I `git reset --hard` the branch and the installed recipe. Did `git reset --hard` again and installed recipe again - nothing changed. I also tried installing `@internationalized/date`, which are appears in the log (https://www.npmjs.com/package/@internationalized/date/v/3.0.0-nightly.2967), but the error is the same.
My personal assumption - nextjs compiler (https://nextjs.org/docs/architecture/nextjs-compiler), which is now SWC (this also appears in the log, you can see it).
Halp!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `blitz install next-ui` steps with the reported Blitz, Next.js, React, and Node versions. Inspect the recipe changes to `_app.tsx` and `LabeledTextField`, then follow the import trace beginning at `@internationalized/date`; done means the generated app builds without the missing `@swc/helpers` module error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.