-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
yarn dev issue with new package structure #664
Comments
@xbassols - I ended up running the build command on each workspace. example:
i did that for each of the following: "@vercel/commerce", Now i get this error: |
@xbassols - got past my error with using node v16, next you would need to configure the appropriate env variable for the particular store you are using i.e. shopify etc etc |
Fixed, so for those that happen to have the same problem:
Thanks for the help! |
@xbassols - Thanks for the input .. but I am still facing some issues
In the next-commerce run I get this error
Am I missing some step or configuration . I just want to get this running with the local (placeholder commerce provider) |
Ok debugged it a bit and it boils down to this call in the
This is failing Its probably a windows specific issue Changing it to the hard coded value makes it work
|
Please see PR #670 as a possible fix |
Thank you for the methord. I run this code |
I'll be working today on a fix for this, TL;DR |
yarn workspace @vercel/commerce-local run dev
yarn workspace v1.22.10
yarn run v1.22.10
$ taskr
node:internal/modules/cjs/loader:361
throw err;
^
Error: Cannot find module '\node_modules\mri\lib\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Documents\GitHub\proj\node_modules\taskr\lib\cli\options.js:3:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Documents\GitHub\proj\node_modules\taskr\lib\cli\index.js:6:11)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Documents\\GitHub\\proj\\node_modules\\mri\\package.json',
requestPath: 'mri'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: C:\Users\user\AppData\Roaming\npm\node_modules\yarn\lib\cli.js run dev
Directory: C:\Users\user\Documents\GitHub\proj\packages\local
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. The commands didn't work 🤷♂️ - I just recommending everyone to checkout |
For windows users change
to
|
@devnajam That worked!! Thank you! |
@mrcampbell Hey I tried that and I am getting Update: I ran it in the |
@HeavenlyEntity Can you please tell me which operating system you are using, the code I shared above works for me on windows but when I push it to server it does not work, but switching back to original works on server and not on windows. To keep my work going I just used the processes.env.NODE_ENV to check if I am in development environment or not and then I use the old and new path respectively. This module not found error has a lot to do with the operating systems, otherwise why will the dev team leave a bug like this in the main branch of code |
for everyone facing this issue, please try to run the same code on Linux, Mac OS and windows and see what different results you get. |
I am running Windows 10 Pro. It won't let me run the server locally it keeps giving me that same error. 🤔 |
@HeavenlyEntity did you try this it works on windows. |
Yes it doesn't work. The I get: Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Cannot Find Module: '...node_modules\@vercel\commerce\dist\config.cjs' Update: Ran in root folder then went back to Error: Cannot find module '...\node_modules\@vercel\commerce\dist\index.js' |
If you see the dist folder it is ignored by git, because it is generated
when you run yarn dev in root folder. Changes made in dist folder won't
have any effect.
…On Mon, Mar 7, 2022, 7:55 AM Alec M ***@***.***> wrote:
For windows users
change
const commerceNextConfig = importCwd(
path.join(provider, 'next.config.cjs')
)
to
const commerceNextConfig = importCwd(
path.join(provider, '/dist/next.config.cjs')
)
@HeavenlyEntity <https://github.com/HeavenlyEntity> did you try this it
works on windows.
Yes it doesn't work. The config.cjs is not even in the dist folder its in
the src folder according to opening up the node_modules folder.
—
Reply to this email directly, view it on GitHub
<#664 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APCXX3NZXLCRLV343A5EWE3U6VVYHANCNFSM5NLTLOOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yeah what I'm saying is there is no So I have fixed the problem! I have placed a pull request in for the problematic library that they are using called |
yarn workspace @vercel/commerce run dev worked for me. |
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 oryarn 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
The text was updated successfully, but these errors were encountered: