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

Break project after install #1157

Open
1 task
kpk000 opened this issue Nov 20, 2024 · 6 comments
Open
1 task

Break project after install #1157

kpk000 opened this issue Nov 20, 2024 · 6 comments

Comments

@kpk000
Copy link

kpk000 commented Nov 20, 2024

What version of million are you using?

3.1.11

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Windows 11

What browser are you using?

Firefox

Describe the Bug

After following the docs for next js, after runing development server, the project can not find any component.

pnpm run dev

The project compiles, but after going to the browser and rendering:

Module not found: Can't resolve './accordion.tsx.tsx'


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



./components/ui/avatar.tsx.tsx
Module not found: Can't resolve './avatar.tsx.tsx'


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



./components/ui/toaster.tsx.tsx
Module not found: Can't resolve './toaster.tsx.tsx'


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


    at processIssues (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\turbopack-utils.js:229:15)
    at handleRouteType (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\turbopack-utils.js:386:17)
    at async Object.ensurePage (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\hot-reloader-turbopack.js:651:17)
    at async DevBundlerService.ensurePage (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\lib\dev-bundler-service.js:18:20)     
    at async DevServer.ensurePage (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\next-dev-server.js:551:9)
    at async Object.ensure (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\next-dev-server.js:169:17)
    at async DevRouteMatcherManager.matchAll (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\future\route-matcher-managers\dev-route-matcher-manager.js:96:13)
    at async DevRouteMatcherManager.match (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\future\route-matcher-managers\default-route-matcher-manager.js:155:26)
    at async NextNodeServer.handleCatchallRenderRequest (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\next-server.js:228:31)  
    at async DevServer.handleRequestImpl (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\base-server.js:810:17)
    at async C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\next-dev-server.js:339:20
    at async Span.traceAsyncFn (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\trace\trace.js:154:20)
    at async DevServer.handleRequest (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\dev\next-dev-server.js:336:24)
    at async invokeRender (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\lib\router-server.js:173:21)
    at async handleRequest (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\lib\router-server.js:350:24)
    at async requestHandlerImpl (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\lib\router-server.js:374:13)
    at async Server.requestListener (C:\Users\karim\Desktop\appquilaFrontend\node_modules\.pnpm\next@14.2.14_@babel+core@7.26.0_react-dom@18.3.1_react@18.3.1__react@18.3.1\node_modules\next\dist\server\lib\start-server.js:141:13)
  Compiled /_error in 465ms
 GET / 500 in 13039ms```

All routes break, it can not find any component,
tsconfig,json:
```{
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "baseUrl":".",
    "paths": {
      
      "@components/*": ["components/*"],
      "@lib/*": ["lib/*"],
      "@store/*": ["store/*"],
      "@hooks/*": ["hooks/*"],
      "@public/*": ["public/*"],
      "@types/*": ["types/*"],
      "@providers/*": ["providers/*"],
      "@schemas/*": ["schemas/*"],
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "typesDTO.d.ts", "tailwind.config.mts"],
  "exclude": ["node_modules"]
}

What's the expected result?

Expected result was to render

Link to Minimal Reproducible Example

a

Participation

  • I am willing to submit a pull request for this issue.
Copy link

Thanks for opening this issue! A maintainer will review it soon.

@jiaweing
Copy link

I have the same issue.

@asterikx
Copy link

Also having the same issue.

@highergroundstudio
Copy link

Same. Using yarn w/ turbopack and next 15.0.3. Only way is to remove unfortunately.

@gruckion
Copy link

Same issue using pnpm, turbopack and turborepo.

This happens with a fresh t3 stack app.

So I just did a simple console.log;

const y = MillionLint.next({
  enabled: true,
  rsc: true,
  turbo: true,
 })(config);

console.log(JSON.stringify(y, null, 2));

And we can see;

export default {
  "experimental": {
    "turbo": {
      "rules": {
        "**/*.tsx": {
          "as": "*.tsx",
          "loaders": [
            {
              "loader": "@million/lint/loader",
              "options": {
                "enabled": true,
                "rsc": true,
                "turbo": true,
                "framework": "next"
              }
            }
          ]
        },
        "**/*.jsx": {
          "as": "*.jsx",
          "loaders": [
            {
              "loader": "@million/lint/loader",
              "options": {
                "enabled": true,
                "rsc": true,
                "turbo": true,
                "framework": "next"
              }
            }
          ]
        }
      }
    }
  }
};

So all this is doing is configuring the experimental turbo flag to define two rules.

https://nextjs.org/docs/app/api-reference/next-config-js/turbo

Changing the "as": "*.tsx", to be "as": "*", fixes the issue.

However having to configure the loading for a big mono repo with loads of packages and aliases is a massive damn. So this is not a simple enough experience for me to apply this to my production project.

@AntonIXO
Copy link

fixes the issue

All you need is to disable turbopack. It seems like million js disabled it before, but then it breaks and you had to do this manually now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants