Skip to content

[Error [TurbopackInternalError]: Expected to find module #278

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

Closed
pamartn opened this issue Feb 12, 2025 · 5 comments
Closed

[Error [TurbopackInternalError]: Expected to find module #278

pamartn opened this issue Feb 12, 2025 · 5 comments

Comments

@pamartn
Copy link

pamartn commented Feb 12, 2025

Hi,

I just installed yak version 4.1.1 with NextJS 15.1.7.

I got an error while running npm run dev.

Does someone know how to fix it ?

My best guess is that there is dependency version problem.
Maybe because my NextJS or React version is too new ?

I also tried npm run ci.

Thanks !

The error :

> [email protected] dev
> next dev --turbopack

 ⚠ Port 3000 is in use, trying 3001 instead.
   ▲ Next.js 15.1.7 (Turbopack)
   - Local:        http://localhost:3001
   - Network:      http://192.168.1.243:3001
   - Experiments (use with caution):
     · turbo
     · swcPlugins

 ✓ Starting...
[Error [TurbopackInternalError]: Expected to find module

Debug info:
- Execution of *get_written_endpoint_with_issues failed
- Execution of *MiddlewareEndpoint::new failed
- Execution of Project::middleware_context failed
- Execution of *NextEcmascriptClientReferenceTransition::new failed
- Execution of *FullContextTransition::new failed
- Execution of *ModuleAssetContext::new failed
- Execution of get_client_module_options_context failed
- Expected to find module]

My next config :

import type { NextConfig } from "next";
import { withYak } from "next-yak/withYak";

const nextConfig: NextConfig = {
  webpack: (config) => {
    config.module.rules.push({
      test: /\.po$/,
      type: 'json',
      use: [
        {
          loader: '@lingui/loader',
          options: {
            sourceLocale: 'en'
          }
        }
      ]
    });
    return config;
  },
  experimental: {
    swcPlugins: [['@lingui/swc-plugin', {}]],
    turbo: {
      rules: {
        '*.po': {
          loaders: ['@lingui/loader'],
          as: '*.js'
        }
      }
    }
  }
}
export default withYak(nextConfig);

My package.json :

 "dependencies": {
    "@lingui/core": "^5.2.0",
    "@lingui/loader": "^5.2.0",
    "@lingui/macro": "^5.2.0",
    "@lingui/react": "^5.2.0",
    "negotiator": "^0.6.3",
    "next": "15.1.7",
    "next-yak": "^4.1.1",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@lingui/cli": "^5.2.0",
    "@lingui/swc-plugin": "^5.1.0",
    "@types/negotiator": "^0.6.3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.1.7",
    "typescript": "^5"
  }

@Mad-Kat
Copy link
Contributor

Mad-Kat commented Feb 12, 2025

Hey @pamartn

Thanks for opening this issue. Is it right that you use turbopack?

Unfortunately at the moment this only works for next.js without turbopack, but we're trying our best to make it possible. See for example here

@pamartn
Copy link
Author

pamartn commented Feb 13, 2025

Hi @Mad-Kat

I disabled turbopack and it works, awesome, thank you so much !!

@Mad-Kat
Copy link
Contributor

Mad-Kat commented Feb 13, 2025

Thank you for the update. If you have any other problems or question feel free to ask and open issues. We're always happy to help

@Mad-Kat Mad-Kat closed this as completed Feb 13, 2025
@jantimon
Copy link
Collaborator

currently we are blocked by this issue - once vercel adds virtual modules to turbopack we will try once again:

vercel/next.js#74825

@Mad-Kat
Copy link
Contributor

Mad-Kat commented May 2, 2025

We've created a tracking issue for turbopack

#336

Feel free to watch it in order to get notified when we're able to support turbopack

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

No branches or pull requests

3 participants