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]: Combining Deno2 with NEXT.js and shadcn is failing #5348

Open
2 tasks done
Cyb3rFl3x opened this issue Oct 12, 2024 · 0 comments
Open
2 tasks done

[bug]: Combining Deno2 with NEXT.js and shadcn is failing #5348

Cyb3rFl3x opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Cyb3rFl3x
Copy link

Describe the bug

Currently, I am trying to run NEXT.js with Deno2 and shadcn. Everything is working till I want to start adding shadcn components in my project.

  • The issue is only coming up if I add a shadcn button in my page.tsx
  • Webpack is installed
  • Tested with a fresh project

I got following output after doing shadcn init and adding a button and start next.js with deno task dev:

As an Error in Next.js

Error: __webpack_modules__[moduleId] is not a function
This error happened while generating the page. Any console logs will be displayed in the terminal window.
__webpack_require__
file:/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js (33:42)
eval
/./lib/utils.ts, <anonymous>
Object.(rsc)/./lib/utils.ts
file:/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js (173:1)

In the CLI:

deno task dev
Task dev next dev
  ▲ Next.js 14.2.15
  - Local:        http://localhost:3000

 ✓ Starting...
 ✓ Ready in 3.3s
 ○ Compiling /_not-found ...
 ✓ Compiled /_not-found in 7.1s (475 modules)
 GET /_next/static/webpack/5d24c43cbc296b0b.webpack.hot-update.json 404 in 7649ms
 ⚠ Fast Refresh had to perform a full reload due to a runtime error.
 ✓ Compiled in 765ms (239 modules)
 ○ Compiling / ...
 ✓ Compiled / in 1095ms (525 modules)
 ⨯ TypeError: __webpack_modules__[moduleId] is not a function
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./lib/utils.ts, <anonymous>:6:72)
    at Object.(rsc)/./lib/utils.ts (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:173:1)
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./components/ui/button.tsx, <anonymous>:12:68)
    at Object.(rsc)/./components/ui/button.tsx (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:162:1)
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./app/page.tsx, <anonymous>:8:79)
    at Object.(rsc)/./app/page.tsx (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:151:1)
    at Function.__webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eventLoopTick (ext:core/01_core.js:214:9)
    at async Promise.all (index 0)
digest: "773026919"
...
...
...
 GET / 500 in 272ms
 ○ Compiling /favicon.ico ...
 ✓ Compiled /favicon.ico in 841ms (354 modules)
 GET /favicon.ico 200 in 1039ms
´´´

### Affected component/components

Run dev server

### How to reproduce

```bash
deno run -A npm:create-next-app@latest
cd demo
deno task dev    # Next.js started
deno install npm:shadcn@latest 
npx shadcn init
npx shadcn add button
# added component like in the next session
deno task dev # failed

code:

import { Button } from "@/components/ui/button";

export default function Home() {
  return (
        <Button/>
  );
}

Codesandbox/StackBlitz link

is not possible because its a startup issue and not a code issue

Logs

deno task dev
Task dev next dev
  ▲ Next.js 14.2.15
  - Local:        http://localhost:3000

 ✓ Starting...
 ✓ Ready in 3.3s
 ○ Compiling /_not-found ...
 ✓ Compiled /_not-found in 7.1s (475 modules)
 GET /_next/static/webpack/5d24c43cbc296b0b.webpack.hot-update.json 404 in 7649ms
 ⚠ Fast Refresh had to perform a full reload due to a runtime error.
 ✓ Compiled in 765ms (239 modules)
 ○ Compiling / ...
 ✓ Compiled / in 1095ms (525 modules)
 ⨯ TypeError: __webpack_modules__[moduleId] is not a function
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./lib/utils.ts, <anonymous>:6:72)
    at Object.(rsc)/./lib/utils.ts (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:173:1)
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./components/ui/button.tsx, <anonymous>:12:68)
    at Object.(rsc)/./components/ui/button.tsx (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:162:1)
    at __webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eval (./app/page.tsx, <anonymous>:8:79)
    at Object.(rsc)/./app/page.tsx (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/app/page.js:151:1)
    at Function.__webpack_require__ (/Users/felix/Workspace/Stuff/denodemo/demo/.next/server/webpack-runtime.js:33:42)
    at eventLoopTick (ext:core/01_core.js:214:9)
    at async Promise.all (index 0)
digest: "773026919"
...
...
...
 GET / 500 in 272ms
 ○ Compiling /favicon.ico ...
 ✓ Compiled /favicon.ico in 841ms (354 modules)
 GET /favicon.ico 200 in 1039ms

System Info

MacOS Sonoma, Firefox, ...

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@Cyb3rFl3x Cyb3rFl3x added the bug Something isn't working label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant