Skip to content

[BUG]: Uncaught TypeError in NextJS integration initialization #230

@MrChrisRodriguez

Description

@MrChrisRodriguez

dmno version

0.0.39

Steps to reproduce

  1. Have monorepo.
  2. Have OpenNextJs package in monorepo.
  3. Run dmno init at monorepo root.
  4. Accept nextjs integration for package.

What is expected?

Successful installation with success or warning, not error.

What is actually happening?

Type error. See full printout below. Note: I'm using a locally built version in my libs, but the same error / error message occurs with the prod version (minus the accurate version number):

╭────────────────────────────────────────────────────────────────╮
│                                                                │
│   Initializing dmno in workspace package - confiador-website   │
│   /workspace/apps/confiador-website                            │
│                                                                │
╰────────────────────────────────────────────────────────────────╯
Resolving dependencies
Resolved, downloaded and extracted [57]
Saved lockfile
✨ dmno installed
   📦 dmno @ "^0.0.39"
It looks like this package uses next!
✔ Would you like to install the @dmno/nextjs-integration package? Yes
Resolving dependencies
Resolved, downloaded and extracted [6]
warn: incorrect peer dependency "[email protected]"
Saved lockfile
✨ DMNO + next integration installed!
   📦 @dmno/nextjs-integration @ "^0.0.14"
 DMNO will make the following changes to your config file 
> Filename: next.config.ts

import { dmnoNextConfigPlugin } from "@dmno/nextjs-integration";
import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";

// Initialize OpenNext Cloudflare for development
initOpenNextCloudflareForDev();

const nextConfig: NextConfig = {};

const withNextIntl = createNextIntlPlugin();
export default dmnoNextConfigPlugin()(withNextIntl(nextConfig));
 -------------------------------------------------------- 
✔ Continue? Yes
✨ next.config.ts updated to set up @dmno/nextjs-integration
   📂 /workspace/apps/confiador-website/next.config.ts
TypeError: Cannot read properties of undefined (reading 'dev')
    at initDmnoForService (file:///workspace/libs/dmno/dist/cli/cli-executable.js:1354:60)
    at async DmnoCommand.<anonymous> (file:///workspace/libs/dmno/dist/cli/cli-executable.js:1639:11)
    at async DmnoCommand.parseAsync (/workspace/node_modules/commander/lib/command.js:936:5)
    at async file:///workspace/libs/dmno/dist/cli/cli-executable.js:1806:3
✨ .dmno/config.mts created!
   📂 /workspace/apps/confiador-website/.dmno/config.mts
   🚧 Please review and update this config file!
✅ .dmno/.env.local already exists!
   📂 /workspace/apps/confiador-website/.dmno/.env.local
✨ .dmno/tsconfig.json created!
   📂 /workspace/apps/confiador-website/.dmno/tsconfig.json
✨ injecting dmno types - created dmno-env.d.ts file
   📂 /workspace/apps/confiador-website/src/dmno-env.d.ts
   📚 see docs @ https://dmno.dev/docs/guides/typescript

System Info

System:
    OS: Linux 6.10 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (12) arm64 unknown
    Memory: 2.93 GB / 7.65 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
npmPackages:
    @biomejs/biome: ^2.0.5 => 2.0.6 
    dmno: ^0.0.39 => 0.0.39 
    execa: ^9.6.0 => 9.6.0 
    wrangler: catalog: => 4.22.0

Any additional comments?

I haven't dug in to the source, but my completely uninformed guess is that it's looking for dev in my package.json and throwing an error because it's not finding one (I use moon and/or nx, so all of my tasks are managed elsewhere).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions