question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Turborepo support (Currently `INIT_CWD` workaround required)

See original GitHub issue

When using contentlayer inside turbo repo, the config gives an error for importing contentlayer/source-files

This is the same repository for reproduction of the same: https://github.com/0xdhrv/turborepo-with-contentlayer

And, inside apps/starter

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
schicklingcommented, Jul 5, 2022

@jrolfs would you please mind opening a new issue for this with a reproduction repo? (Ideally also including some snippets how you would like it to work vs how it’s currently working.)

(PS: In the upcoming version you’ll be able to specify the config path in the Next.js plugin - see #248)

2reactions
schicklingcommented, Mar 14, 2022

Hi @0xdhrv. Thanks for opening this issue and providing a repro. I’ve just given it a try and can confirm the problem you’re running into. This is currently happening due to a limitation in Turborepo itself (see https://github.com/vercel/turborepo/issues/485).

However, until this is resolved you can workaround the problem by simply adding INIT_CWD=$PWD in front of next build in your package.json like the following:

// apps/starter/package.json
  "scripts": {
     // ...
    "build": "INIT_CWD=$PWD next build",
    // ...
  },

Related:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set `INIT_CWD` environment variable · Issue #485 · vercel/turbo
schickling mentioned this issue on Feb 1. Turborepo support (Currently INIT_CWD workaround required) contentlayerdev/contentlayer#104.
Read more >
Turborepo Quickstart
Turborepo is an intelligent build system optimized for JavaScript and TypeScript codebases. Your codebase's tasks - like lint , build and test - ......
Read more >
Intelligent ignored builds using Turborepo - Vercel
When deployed on Vercel, Turborepo now supports only building affected projects via the new turbo-ignore npm package, saving time and ...
Read more >
Tuning initcwnd for optimum performance - CDN Planet
Tuning the initial congestion window parameter (initcwnd) on the server can have a significant improvement in TCP performance, resulting in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found