Next.js Discord

Discord Forum

Cant resolve index.js paths with Turbopack

Unanswered
Satin Angora posted this in #help-forum
Open in Discord
Satin AngoraOP
I am trying to migrate from webpack to turbopack in my next 14.2 monorepo application

When I run project with turbo I get this error:
./packages/common/src/openAI/index.ts:2:1
Module not found: Can't resolve '../config/index.js'
  1 | import { OpenAI } from 'openai'
> 2 | import { config } from '../config/index.js'
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3 |
  4 | export * from 'openai'
  5 | export * from './campaign/index.js'

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

With webpack everything works good, It is because I have this config in place:
    const extensionAlias = config.resolve.extensionAlias
    config.resolve.extensionAlias = {
      ...extensionAlias,
      '.js': ['.js', '.ts'],
    }

But for turbopack there is no equivalent? How can I fix this so I manage to run turbopack?

2 Replies

Satin AngoraOP
some1 help pls ❤️
Satin AngoraOP
pleaseee ❤️