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.

yarn dev issue with new package structure

See original GitHub issue

Hello,

I’ve been trying to port our project to the new package structure and I’m getting a problem with yarn dev inside site or yarn workspaces run dev.

When executed it requires the packages commerce and ours need to be prebuilt (because is trying to link with the dist folder).

For example the error that pops up if you run right away:

error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error Error: Cannot find module ‘/…/commerce/node_modules/@vercel/commerce/dist/config.cjs’

What is the optimal setup/commands to run the project with the current structure?

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
devnajamcommented, Mar 7, 2022

For windows users

change

const commerceNextConfig = importCwd(
  path.join(provider, 'next.config.cjs')
)

to

 const commerceNextConfig = importCwd(
    path.join(provider, '/dist/next.config.cjs')
  )
1reaction
mrcampbellcommented, Mar 6, 2022

@devnajam That worked!! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a Package - Yarn
A package is a directory with some code and a package.json file that provides information to Yarn about your package. Most packages use...
Read more >
Yarn - How do I update each dependency in package.json to ...
Clear your node_modules folder and yarn.lock , yarn-error.log files. Then try yarn --ignore-engines . After successful instllations, try yarn ...
Read more >
Yarn: A new package manager for JavaScript
Yarn resolves these issues around versioning and non-determinism by using lockfiles and an install algorithm that is deterministic and reliable.
Read more >
Why you should prefer using pnpm over npm and yarn? | refine
Let's start with discussing the issues in existing package managers. ... This is how the structure of node modules will look like:.
Read more >
JavaScript Package Managers: NPM Vs YARN Vs PNPM
Before npm version 3, the node_modules structure was predictable. The problem with this approach was twofold: windows was frequently having ...
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